Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

3 Answers 3

up vote 3 down vote accepted

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

share|improve this answer

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.
share|improve this answer

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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