June 12, 2014 - rob

Monitor vsftp connections

Monitor

Add the following two lins to the vsftpd.conf file

setproctitle_enable=YES
session_support=YES

The first one allows you to monitor all current sessions along with what’s going on in the session, what’s the source IP, etc, by simply listing the current processes:

ps ax | grep vsftpd | grep -v grep

Or, if you prefer:

watch -n 1 'ps ax | grep vsftpd | grep -v grep'

Example:

  • Note: If there are no current connections these commands will not show any results.
ps ax | grep vsftpd | grep -v grep
32668 ? S 0:00 vsftpd: LISTENER
985 ? Ss 0:00 vsftpd: 192.168.0.12: connected
989 ? S 0:00 vsftpd: 192.168.0.12/florin: IDLE

The second one will reveal vsftpd sessions using the “last” command.

Linux