Monday, November 9, 2009

Ban Pure-FTPd login attempts by IP after three failures

A handy tip for anyone using Pure-FTP, be it Linux or Mac.

Ban Pure-FTPd login attempts by IP after three failures: "I run an FTP server on my machine, using Pure-FTPd. Lately, I was getting a lot of noise in my logs about unknown people trying to gain access on my FTP server. I wanted to automate the task of looking through the log and banning the bad IPs, so that my logs will be kept clean from all those try/fails attempts.



What I came up with is a bash script executed as a launchd user daemon whenever the file /var/log/ftp.log is being modified. Parts of the code come from , and irc2samus on the #bash channel (IRC on freenode.net) made the rest.



I thought this might help others, too, so here's the code.
I put the following in /etc/autoban/ftp_ban.sh:

...



Add to digg
Add to Reddit
Add to Slashdot
Email this Article
Add to StumbleUpon



"



(Via MacOSXHints.com.)

No comments: