拒绝主机 – 每当我阻止自己

因为我安装了DenyHosts,所以如果我想通过sshlogin到我的服务器,我得到错误“ssh_exchange_identification”。 如果我查找/etc/hosts.deny我发现我的IP在那里。 我怎么能防止我的IP每次都在里面呢?

也许你testing了拒绝主机应该阻止用户的一个条件,例如以root身份login。 这里是你可以做什么来重置hosts.deny文件,这样你就可以再次login(从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

把自己放在/etc/hosts.allow。 处理顺序如下,匹配后停止:

  • 根据/etc/hosts.allow中的规则授予访问权限
  • 根据/etc/hosts.deny中的规则拒绝访问
  • 授予访问权限。

创build一个名为WORK_DIR / allowed-hosts的文件并input您的IP。 重新启动Denyhosts。