I recently setup a VPS and installed Denyhosts. I must have entered an incorrect password at some point cause I couldn’t SSH into my server. After removing my IP from /etc/hosts.deny I could log in once but after that I was added to the hosts.deny file again.
To completely remove an IP address from Denyhosts you’ll need to…
- Stop DenyHosts – sudo /etc/init.d/denyhosts stop
- Remove the IP address from /etc/hosts.deny
- Edit /var/lib/denyhosts/hosts and remove the lines containing the IP address. Save the file.
- Edit /var/lib/denyhosts/hosts-restricted and remove the lines containing the IP address. Save the file.
- Edit /var/lib/denyhosts/hosts-root and remove the lines containing the IP address. Save the file.
- Edit /var/lib/denyhosts/hosts-valid and remove the lines containing the IP address. Save the file.
- Edit /var/lib/denyhosts/user-hosts and remove the lines containing the IP address. Save the file.
- (optional) Consider adding the IP address to /var/lib/denyhosts/allowed-hosts
- Start DenyHosts- sudo /etc/init.d/denyhosts start