2

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?

3

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

  • This is what I did too @jOnes, but is there a better way? My IP address will change since it's dynamically assigned by my ISP right? – ericn Jan 26 '15 at 15:46
2

Put yourself in /etc/hosts.allow. The order of processing goes as follows, stopping after there is a match:

  • Grant access based on rules in /etc/hosts.allow
  • Deny access based on rules in /etc/hosts.deny
  • Grant access.
1

Create a file named WORK_DIR/allowed-hosts and input your IP. Restart Denyhosts.

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.