SSH: Connection refused – banned IP address, unban and allow access
If you or your client can not connect to your UNIX server through SSH or if you would like to grant or deny access to a specific ip address, follow this easy guide.
First, look in
/var/log/secure file for a line that looks like:
Jun 29 09:05:41 myserver sshd: refused connect from ::ffff:209.123.456.123 (::ffff:209.123.456.123)
The command is
cat /var/log/secure | grep 209.123.456.123 (where
209.123.456.123 is your ip).
If your ip is in that file along with a word refused, that means that the server is blocking your address. If you can not locate the line with your ip, then the problem is on your side, and not on the server.
Next step is to delete your ip-address from a list of blocked ones. To open the file with a list of all blocked ip-addresses, type
vi /etc/hosts.deny and then delete a line with your ip-address. You could also add the line you deleted into
/etc/hosts.allow file (the line should look like
Save files and exit. You dont have to restart any services, the connection from the previously blocked ip-address should be accepted right away.
More information can be found here: http://www.freebsddiary.org/ssh_refused.php
Trackback from your site.