denyhosts 不断添加我的 IP [英] denyhosts keeps adding back my IP

查看:39
本文介绍了denyhosts 不断添加我的 IP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试解除阻止我进行一些测试的 IP.我是按照网上的教程来的:

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.hosts
[remove the last line where I can see my IP to clear]
$ cd /var/lib/denyhosts/
$ sudo vim *
[remove any occurences of my IP to clear]
$ sudo /etc/init.d/denyhosts start

此时我的 IP 又出现在/etc/deny.hosts 中.我也试过:

At this moment my IP appears back into /etc/deny.hosts. I tried also:

$ cd /var/lib/denyhosts/
$ echo '123.456.789.122' >> /var/lib/denyhosts/allowed-hosts

我也试过:

$ echo 'my.ip.to.clear' >> /etc/hosts.allow

不幸的是,hosts.deny 总是优先,拒绝 ssh 连接,从日志文件可以看出:

Unfortunately the hosts.deny always takes precedence, and refuse ssh connection, as can be seen from the log file:

2 月 10 日 10:06:24 ks123456 sshd[22875]:拒绝连接123.456.789.122 (123.456.789.122)

Feb 10 10:06:24 ks123456 sshd[22875]: refused connect from 123.456.789.122 (123.456.789.122)

参考:debian/6.0.4,denyhosts 2.6-10

ref: debian/6.0.4, denyhosts 2.6-10

推荐答案

可以在此处找到删除 denyhosts 条目的说明:http://www.cyberciti.biz/faq/linux-unix-delete-remove-ip-address-that-denyhosts-blocked/.在 Ubuntu 中,denyhosts 数据文件位于 /var/lib/denyhosts.

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. 确保拒绝主机中没有代表您 IP 地址的域名的条目.
  2. 从/etc/deny.hosts(对于 Ubuntu 为/etc/hosts.deny)中删除所有出现的 IP 地址和域名后,如果您仍然无法登录,请检查身份验证日志,通常在:/var/log/auth.log它可能会为您提供有关问题所在的线索.
  3. 如果您在服务器和客户端上都运行 linux,您可能需要使用 ssh-copy-id,这样您就不需要密码登录,以防止因使用错误密码太多次而将自己锁定未来.
  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.

我自己遇到了问题,因为我使用 sftp 在 KDE 上的 Dolphin 中保存了一个位置到我的服务器.Dolphin 使用您当前的用户名尝试登录,从而将我的 IP 添加到 hosts.deny 文件中.

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.

这篇关于denyhosts 不断添加我的 IP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆