我未能成功连接到服务器。以下是连接的输出
$ ssh -v [server]
OpenSSH_5.1p1 Debian-3ubuntu1, OpenSSL 0.9.8g 19 Oct 2007
debug1: Reading configuration data /home/tim/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to [server] [server ip] port 22.
debug1: Connection established.
debug1: identity file /home/tim/.ssh/identity type -1
debug1: identity file /home/tim/.ssh/id_rsa type 1
debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048
debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048
debug1: identity file /home/tim/.ssh/id_dsa type -1
ssh_exchange_identification: Connection closed by remote host`
有人知道哪里出了问题吗?谢谢!
答案1
检查您连接的 IP 是否显示在/etc/hosts.deny
远程服务器上,并检查您是否有大量登录失败尝试/var/log/secure
。如果有,请从两个文件中删除这些条目,然后您就可以重新登录。
答案2
sh_exchange_identification:即使密钥正确,远程主机也会关闭连接
通过控制台登录或尝试在 ssh 中多次登录
然后检查 /var/log/btmp 的权限,它必须是 600 chmod 600 /var/log/btmp
答案3
另外,尝试在不使用私钥的情况下登录。我知道的唯一方法是暂时移开你的私钥文件。