Dav*_*ong 0 ssh debian denyhosts
所以我处于一个非常棘手的情况。我已经在我的 debian 机器上安装了 denyhosts,突然我不能再使用 SSH。
希望我仍然可以通过 webmin 登录,但是使用 root,所以我不得不用另一个用户登录,然后“su”。
我刷新了 IPtables,将 SSH 的端口更改回 22(我之前更改过)并尝试删除 denyhosts:aptitude remove denyhosts。
它似乎不起作用:
E: 等待 /usr/bin/apt-listchanges --apt || 测试 $? -ne 10 但它不是 re E: Failure running script /usr/bin/apt-listchanges --apt || 测试 $? -ne 10
在这一点上我真的不知道该怎么做,我仍然无法通过 SSH 连接,而且我在 webmin 中只有这个文本终端,它允许我这样做,但速度很慢。任何的想法 ?
PS:
当我现在进行 aptitude 升级时,出现错误:
Get:1 http://security.debian.org/ squeeze/updates/main file amd64 5.04-5+squeeze 5 [50.3 kB]
Get:2 http://security.debian.org/ squeeze/updates/main libmagic1 amd64 5.04-5+sq ueeze5 [236 kB]
Fetched 286 kB in 0s (622 kB/s)
dpkg-deb: unrecoverable fatal error, aborting:
wait for subprocess tar failed: No child processes
close failed in file object destructor:
IOError: [Errno 10] No child processes
Traceback (most recent call last):
File "/usr/bin/apt-listchanges", line 237, in <module> main()
File "/usr/bin/apt-listchanges", line 102, in main
pkg = DebianFiles.Package(deb)
File "/usr/share/apt-listchanges/DebianFiles.py", line 133, in __init__
self.binary = pkgdata.Package
AttributeError: ControlStanza instance has no attribute 'Package'
E: Waited for /usr/bin/apt-listchanges --apt || test $? -ne 10 but it wasn't the re
E: Failure running script /usr/bin/apt-listchanges --apt || test $? -ne 10 A package failed to install. Trying to recover:
Run Code Online (Sandbox Code Playgroud)
当我安装或重新安装拒绝主机时,我遇到了同样的错误......
denyhosts它的工作原理是将条目添加到/etc/hosts.deny文件中发现它违反了您为其设置的规则的 IP 地址。
您似乎尝试root通过 SSH登录并输错了一次密码。默认情况下,在尝试登录 root 帐户失败后,denyhosts将 IP 地址添加到/etc/hosts.deny文件中。
即使您卸载denyhosts,条目仍将保留在该文件中。因此,您应该编辑/etc/hosts.deny文件并删除与您的 IP 地址相关的条目。
您似乎还允许通过 ssh 进行 root 登录。我认为这不是一个好习惯,您应该以普通用户身份登录并使用 su 获取 root 权限。因此,您应该编辑/etc/ssh/sshd_config,然后更改PermitRootLogin为 no。