Hi
I'm using vsftpd and I want to write a shell script that will detect a connection to my server and send me an email with information who and when has logged in. I don't know where to start. Can someone point me in the right direction.
Thanx
Hi
I'm using vsftpd and I want to write a shell script that will detect a connection to my server and send me an email with information who and when has logged in. I don't know where to start. Can someone point me in the right direction.
Thanx
I'm not familiar with vsftpd, but you could have your shell script look at the output of netstat to see if you've got any connections on port 21 (the default ftp port).
Read the log.
http://www.redhat.com/docs/manuals/enterprise/RHEL-3-Manual/ref-guide/s1-ftp-vsftpd-conf.html
Enable the transfer log.
Read the file.
The most reliable way is using log analysis. If you use a tool like OSSEC (free and open source), it can run any scripts or generate email alerts when logins, logouts, failed logins, etc happens.
link: http://www.ossec.net
Same applies for "fail2ban", though the purpose of this thing is something else (you guessed it).
J.