How to detect ftp connection

I am using vsftpd and I want to write a shell script that detects a connection to my server and sends me an email with information about who logged in and when. I don't know where to start. Can someone point me in the right direction.

Thanx

-1


a source to share


4 answers


Read the magazine.

http://www.redhat.com/docs/manuals/enterprise/RHEL-3-Manual/ref-guide/s1-ftp-vsftpd-conf.html



Enable migration log.

Read the file.

+4


a source


I'm not familiar with vsftpd, but you can force your shell script to look at the netstat output to see if you have any connections on port 21 (the default ftp port).



0


a source


The most reliable way is to use log analysis. If you use a tool like OSSEC (free and open source), it can run any scripts or generate email alerts when login occurs, logout occurs, failed logins, etc.

link: http://www.ossec.net

0


a source


The same goes for "fail2ban", although the purpose of this thing is different (you guessed it).

J.

0


a source







All Articles