Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] [PROFTPD] IP uzytkownikow zalogowanych
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Polskie forum (Polish) Polish OTW
View previous topic :: View next topic  
Author Message
soban_
l33t
l33t


Joined: 27 Aug 2008
Posts: 679
Location: /home/soban

PostPosted: Sun Jun 17, 2012 3:57 pm    Post subject: [SOLVED] [PROFTPD] IP uzytkownikow zalogowanych Reply with quote

Czy jest jakis sposob na wyciagniecie z poziomu basha userow poprawnie zalogowanych na ftp? Chodzi mi o ich adresy IP i nie o wyciagniecie wszystkich polaczen z portu 21 (bo moze to byc np atak prowadzony) tylko o poprawnie zalogowanych juz userow, tak zeby ich wylistowac np w jednym pliku lub cos podobnego. Serwerem ftp jest proftpd, oczywiscie moge go zmienic jesli polecicie cos bardziej przystepnego z takowa mozliwoscia - jak opisalem.
_________________
gg: 525600


Last edited by soban_ on Sun Jun 17, 2012 9:01 pm; edited 1 time in total
Back to top
View user's profile Send private message
SlashBeast
Moderator
Moderator


Joined: 23 May 2006
Posts: 2824

PostPosted: Sun Jun 17, 2012 5:00 pm    Post subject: Reply with quote

Parsuj output ftpwho w awk np.
_________________
BitBucket -- better-initramfs to address many usecases and linux's limitations.
Back to top
View user's profile Send private message
soban_
l33t
l33t


Joined: 27 Aug 2008
Posts: 679
Location: /home/soban

PostPosted: Sun Jun 17, 2012 9:00 pm    Post subject: Reply with quote

Code:
ftpwho -v | grep client | awk '{print $3}' | sed -e 's/\[//;s/\]//'
11.11.11.11
22.22.22.22
Solved, kolejny raz dzieki @SlashBeast za pomoc. No chyba ze bardziej sie da to zoptymalizowac.
_________________
gg: 525600
Back to top
View user's profile Send private message
SlashBeast
Moderator
Moderator


Joined: 23 May 2006
Posts: 2824

PostPosted: Sun Jun 17, 2012 10:38 pm    Post subject: Reply with quote

Code:
ftpwho -v | awk '/client/ { gsub("^\\[|\\]$","", $3); print $3 }'

Nastepnym krokiem w optymalizacji bylo by pewnie uzycie mawk zamiast gnu awk, mawk jest bytecode.
_________________
BitBucket -- better-initramfs to address many usecases and linux's limitations.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Polskie forum (Polish) Polish OTW All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum