How to view and remove banned IP's from Fail2ban on Ubuntu 10.04

If you followed the tutorial, "How to Install and Configure fail2ban on Ubuntu 10.04 for SSH and Pure-FTPd" then you should have Fail2ban installed and configured  for SSH and Pure-FTPd. You may be curious how to view which IP's are banned or blocked by Fail2ban, or you may wan't to remove some of them from the banned list. To view all addresses that are blocked, run the following command:

sudo iptables -L -n

Banned SSH IP's look like this:

Chain fail2ban-ssh (1 references)

target     prot opt source               destination         

DROP       all  --           

RETURN     all  --  


Banned ftp IP's look like this:

Chain fail2ban-pure-ftpd (1 references)

target     prot opt source               destination         

DROP       all  --

To remove an IP address from the banned SSH list, run the following command:

How to Install and Configure fail2ban on Ubuntu 10.04 for SSH and Pure-FTPd

Fail2ban is an intrusion prevention framework. It's main purpose is to block IP addresses belonging to hosts that are trying to breach the system's security. I highly recommend any linux administrator to implement this software. In my example, I will be installing Fail2ban on Ubuntu 10.04 64 bit Server Edition. I will be utilizing Fail2ban for SSH and Pure-FTPd.

To begin, install Fail2ban by running the following command:

sudo apt-get install fail2ban

By default, Fail2ban is Ubuntu friendly, meaning that it is configured to ban IP's after 6 failed SSH attempts. You can verify that it is enabled by viewing the contents of /etc/fail2ban/jail.conf:

cat /etc/fail2ban/jail.conf


Make sure that this section is in there and that it is set to true:



enabled = true

port = ssh

filter = sshd

logpath  = /var/log/auth.log

maxretry = 6


To configure Fail2ban for Pure-FTPd, run the following commands:

sudo vim /etc/fail2ban/jail.conf


Add the following lines to the section labeled "FTP servers":



How to install OpenPanel and Drupal on Ubuntu 10.04 64 Bit Server With Recommended Drupal Permissions (Step 3 of 3)

By now, you should have a complete install of OpenPanel with a user, domain, website, FTP account, and E-mail address. Before we begin to install Drupal, there are a few packages we must install prior:


sudo apt-get install php5-mysql php5-gd

sudo a2enmod rewrite

sudo /etc/init.d/apache2 restart

This section about changing permissions is optional, however I recommend it because It makes the permissions more secure for an Apache Virtual Host environment with multiple users. If you look at the permissions in the home directory, you will notice that OpenPanel sets the default owner and group to the user you created.


root@web1:/home# ls -al

total 20

drwxr-xr-x  5 root            root            4096 2011-10-01 09:23 .

drwxr-xr-x 22 root            root            4096 2011-10-01 06:54 ..

drwxr-xr-x  3 user            user            4096 2011-09-30 21:56 user

drwxr-xr-x  2 openpanel-admin openpanel-admin 4096 2011-09-30 21:52 openpanel-admin

drwx--x--x  3 test            test            4096 2011-10-01 09:30 test


Subscribe to Pure-FTPd