denyhosts keeps adding back my IP

前端 未结 9 1218
Happy的楠姐
Happy的楠姐 2021-01-30 11:39

I am trying to unblock an IP from which I was doing some tests. I have followed the tutorials on the net:

$ sudo /etc/init.d/denyhosts stop
$ sudo vim /etc/deny.         


        
相关标签:
9条回答
  • 2021-01-30 12:10

    If instructions above didn't help maybe denyhosts added IP to iptables firewall.

    iptables -L -n -v | grep xxx.xxx.xxx.xxx

    If you see something like that:

    0 0 DROP all -- * * xxx.xxx.xxx.xxx 0.0.0.0/0

    Remove required IP from firewall:

    iptables -D INPUT -s xxx.xxx.xxx.xxx -j DROP

    And restart networking to apply changes:

    /etc/init.d/networking restart

    0 讨论(0)
  • 2021-01-30 12:10

    Here's what worked for me on CentOS 6.7

    1. Stop DenyHosts (ver 2.6) ./daemon-control stop
    2. Remove line/s with your/target IP address from /etc/hosts.deny
    3. Remove line/s with your/target IP address from /usr/share/denyhosts/data/hosts
    4. Remove line/s with your/target IP address from /usr/share/denyhosts/data/hosts-restricted
    5. Remove line/s with your/target IP address from /usr/share/denyhosts/data/hosts-root
    6. Remove line/s with your/target IP address from /usr/share/denyhosts/data/hosts-valid
    7. Remove line/s with your/target IP address from /usr/share/denyhosts/data/users-hosts
    8. ADD your/target IP address to /usr/share/denyhosts/data/allowed-hosts. This file simply expects one IP per line. Any IP address that appears in this file will not be blocked.
    9. Start DenyHosts ./daemon-control start
    0 讨论(0)
  • 2021-01-30 12:11

    The instructions to remove an entry for denyhosts can be found here: http://www.cyberciti.biz/faq/linux-unix-delete-remove-ip-address-that-denyhosts-blocked/. In Ubuntu the denyhosts data files are located at /var/lib/denyhosts.

    1. Make sure there are not entries that represent the domain name for your IP address in denyhosts.
    2. After removing all occurrences of your IP address, and domain name from /etc/deny.hosts (/etc/hosts.deny for Ubuntu) if you are still unable to log in, check the authentication log usually in: /var/log/auth.log It may give you clues to what your problem is.
    3. If you are running linux on both the server and client, you may want to use ssh-copy-id so that you don't need a password to login to prevent locking yourself out by using the wrong password too many times in the future.

    I had problems myself because I had a location saved in Dolphin on KDE to my sever using sftp. Dolphin uses your current username to try logging in which was getting my IP added to the hosts.deny file.

    0 讨论(0)
提交回复
热议问题