How to add your IP address to the firewall ( for ssh access )
For security reasons, SSH access to your server is blocked at the firewall level. Before you can connect to your account via SSH, you will need to add your local IP address to the firewall.
- Find your IP address. Visit the following url:
Note the IP address that is displayed. This is your IP address as seen by the rest of the internet.
- Log into your WHM. (Web Host Manager)
- Click the "Add IP to Firewall" link in the left menu.
Note! This link is one of the last links in the left menu in WHM. You can also type in the search box at the top right "Add IP" and the link will show on the left.
- Enter your IP address in the "Allow Rule:" field and click the "Add Rule / Restart" button.
If your IP address does not stay the same each time you connect to the internet, you can add a range of IP address so that you do not need to add your new IP address each time it changes. We are unable to advise you with what your IP range is, however your Internet Service Provider should be able to assist you further. You will need to use CIDR formatting when adding a range of IP addresses. Please see the "Information on CIDR Formats" and "IP to CIDR Converter" links in the "Add IP to Firewall" page in WHM for further assistance.
We value your feedback!
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
new! - Enter your name and email address above and we will post your feedback in the comments on this page!
2014-03-09 5:18 am
While following this guide, we wanted to know how to remove IPs that had already been added using the process above.
The WHM documentation refers to a plugin, "ConfigServer & Firewall", which was not installed by default in our managed VPS's WHM. According to IMH tech support, you can opt to install this WHM plugin yourself, or request that they do so (fees may apply).
While looking into SSH options, we checked to see if we could edit entries in the "/etc/ips" file, as is described in:
But that file was empty. We also didn't have access to the iptables command in our shell. So... how could we manage these added entries via SSH?
Tech support pointed us towards the "/etc/apf" file which contains a list of the IPs added via WHM's "Add IP Address to Firewall". The ones we had added via WHM appeared at the end of the file, and we edited it accordingly.Be mindful that there other IP entries in there which should be left as is (eg: the InMotion Hosting section).
2014-03-09 6:10 am
I recently left a comment about removing an IP address after adding it.To restart the firewall after making edits to "/etc/apf" I used the command:
service apf restart
as is listed in your "How To Open A Port in Your Firewall" doc.