Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 17th January 2012, 12:54
iahmedamer iahmedamer is offline
Junior Member
 
Join Date: Dec 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to list the current ftp connections?

Hello,
I need to know How to list the ""current"" ftp connections?
I need info about who r the users/IP who use FTP on my server!


Regards
Ahmed Amer
Cairo,Egypt
Reply With Quote
Sponsored Links
  #2  
Old 18th January 2012, 11:39
bassie bassie is offline
Junior Member
 
Join Date: Jan 2012
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

What FTP server are you using?
Reply With Quote
  #3  
Old 19th January 2012, 04:16
epretorious epretorious is offline
Member
 
Join Date: Feb 2010
Location: Truckee, CA
Posts: 33
Thanks: 3
Thanked 0 Times in 0 Posts
Send a message via AIM to epretorious Send a message via Yahoo to epretorious Send a message via Skype™ to epretorious
Default

Connections are easy enough to track by IP:
Code:
[eric@ispconfig-1 ~]$ grep ftp /etc/services 
ftp-data        20/tcp
ftp-data        20/udp
...
ftp             21/tcp
ftp             21/udp          fsp fspd
...
sftp            115/tcp
sftp            115/udp
...
ftp-data        20/sctp                 # FTP
ftp             21/sctp                 # FTP
...
ftps-data       989/tcp                 # ftp protocol, data, over TLS/SSL
ftps-data       989/udp                 # ftp protocol, data, over TLS/SSL
ftps            990/tcp                 # ftp protocol, control, over TLS/SSL
ftps            990/udp                 # ftp protocol, control, over TLS/SSL
Use netstat to see the open connections. e.g., For simple FTP...
Code:
[eric@ispconfig-1 ~]$ netstat -tan | grep \:21
tcp        0      0 0.0.0.0:21                  0.0.0.0:*                   LISTEN      
tcp        0      0 :::21                       :::*                        LISTEN
Or, if you want confirmation about which program is using [TCP] port 21...
Code:
[eric@ispconfig-1 ~]$ sudo netstat -tanp | grep \:21
tcp        0      0 0.0.0.0:21                  0.0.0.0:*                   LISTEN      4932/pure-ftpd (SER 
tcp        0      0 :::21                       :::*                        LISTEN      4932/pure-ftpd (SER
User sessions are generally trackable by searching /var/log/messages...
Code:
Jan 18 19:07:13 ispconfig-1 pure-ftpd: (?@192.168.0.26) [INFO] New connection from 192.168.0.26
Jan 18 19:07:22 ispconfig-1 pure-ftpd: (?@192.168.0.26) [WARNING] Authentication failed for user [justine]
Jan 18 19:07:30 ispconfig-1 pure-ftpd: (?@192.168.0.26) [INFO] Logout.
Jan 18 19:07:32 ispconfig-1 pure-ftpd: (?@192.168.0.26) [INFO] New connection from 192.168.0.26
Jan 18 19:07:44 ispconfig-1 pure-ftpd: (?@192.168.0.26) [WARNING] Authentication failed for user [eric]
__________________
Eric Pretorious,
Truckee, CA
Reply With Quote
  #4  
Old 19th January 2012, 04:42
erosbk erosbk is offline
Senior Member
 
Join Date: Mar 2011
Posts: 337
Thanks: 49
Thanked 36 Times in 30 Posts
Default

If you are using ftp, you can see who is connected in real time and what type of operation is doing (upload, download) with the following command:

pure-ftpwho
Reply With Quote
The Following User Says Thank You to erosbk For This Useful Post:
epretorious (19th January 2012)
  #5  
Old 19th January 2012, 08:43
bassie bassie is offline
Junior Member
 
Join Date: Jan 2012
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default

I'm running Proftpd. Sometimes I also use the commands "ftpwho" and ftptop".
Hope that helps!
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
rkhunter warnings esezako General 7 27th September 2011 07:28
Hacked server Captain Installation/Configuration 8 23rd December 2010 10:39
rkhunter report Captain Installation/Configuration 6 10th October 2010 13:05
proFTPd passive mode problems bisbell Server Operation 8 6th August 2008 21:12
Question about Virtual Hosting With Proftpd And MySQL (Incl. Quota) On Debian Etch ikkem HOWTO-Related Questions 30 26th February 2008 19:38


All times are GMT +2. The time now is 07:29.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.