Preventing Brute Force Attacks With BlockHosts On Debian Etch - Page 2
3 Creating A BlockHosts Cron Job For Non-TCP_WRAPPERS ServicesTo block hosts from non-TCP_WRAPPERS services such as Debian's ProFTPd, you can run blockhosts.py --iptables --verbose on the command line. Of course, you don't want to do this every few minutes, therefore we create a cron job for this. First we create a little wrapper script for /usr/bin/blockhosts.py: vi /usr/local/sbin/blockhosts
The purpose of this wrapper script is to pass the correct PATH to the /usr/bin/blockhosts.py script; if we use /usr/bin/blockhosts.py directly in the cron job, we will get errors saying that iptables could not be found. Of course, we must make /usr/local/sbin/blockhosts executable: chmod 700 /usr/local/sbin/blockhosts Then, we create a cron job like this: crontab -e
4 TestingNow you can try to log in to your server using SSH and FTP with wrong usernames/passwords. After some time, you shouldn't be able to connect to your server at all which means you got blocked. Change your client's IP address and log in to the server's shell again. Run iptables -L You can see in the output which IP addresses got blocked: server2:~# iptables -L Take a look at /etc/hosts.allow. The same IP addresses should be listed in the #---- BlockHosts Additions section: vi /etc/hosts.allow
Finally, you can also take a look at /var/log/blockhosts.log: tail /var/log/blockhosts.log [...]
5 Links
|
Join the discussion.
www.seamlessenterprise.com
IP Convergence
Integrate your wireless and wireline networks.
Learn how from the experts at Sprint.
www.seamlessenterprise.com
Wireless & Wireline Integration
Thoughts, strategies and solutions: join the discussion
www.seamlessenterprise.com
Unified Communications 2009
Join the Discussion. Now.
www.seamlessenterprise.com





print: 
Recent comments
6 hours 23 sec ago
7 hours 43 min ago
10 hours 8 min ago
10 hours 14 min ago
14 hours 48 min ago
16 hours 49 min ago
20 hours 12 min ago
22 hours 19 min ago
22 hours 30 min ago
1 day 56 min ago