Ssh – DenyHosts – Everytime I block theself

denyhostsssh

Since I installed DenyHosts I get the error "ssh_exchange_identification" if I want to login via ssh to my server. If I lookup /etc/hosts.deny I find my IP inside there. How could I prevent that my IP everytime putted inside there?

Best Answer

Probably you tested one of the conditions where denyhosts should block users, e.g. logging in as root. Here is what you can do to reset the hosts.deny file so that you will be able to login again (from the DenyHosts FAQ):

Stop DenyHosts
Remove the IP address from /etc/hosts.deny
Edit WORK_DIR/hosts and remove the lines containing the IP address. Save the file.
Edit WORK_DIR/hosts-restricted and remove the lines containing the IP address. Save the file.
Edit WORK_DIR/hosts-root and remove the lines containing the IP address. Save the file.
Edit WORK_DIR/hosts-valid and remove the lines containing the IP address. Save the file.
Edit WORK_DIR/user-hosts and remove the lines containing the IP address. Save the file.
(optional) Consider adding the IP address to WORK_DIR/allowed-hosts
Start DenyHosts

http://denyhosts.sourceforge.net/faq.html#3_19