当我尝试通过SSH连接到服务器时,我收到以下错误,
[root@oneeighty ~]# ssh -vvv -p 443 root@xxx.xxx.xxx OpenSSH_4.3p2,OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008 debug1: Reading configuration data /etc/ssh/ssh_config debug1: Applying options for * debug2: ssh_connect: needpriv 0 debug1: Connecting to xxx.xxx.xxx [IP] port 443. debug1: Connection established. debug1: permanently_set_uid: 0/0 debug1: identity file /root/.ssh/identity type -1 debug1: identity file /root/.ssh/id_rsa type -1 debug1: identity file /root/.ssh/id_dsa type -1 debug1: loaded 3 keys ssh_exchange_identification: read: Connection reset by peer
我检查了服务器和客户端上的SSH配置,没有问题.
重新启动服务器上的SSH服务,然后重新启动服务器/客户端,但问题仍未解决.
解决方法
这可能是许多事情的结果.
您可以快速尝试的几件事情如下,
>在/etc/hosts.deny中查找sshd:ALL等条目
>也许,将sshd:ALL添加到/etc/hosts.allow
>您的SSHD的HostKeys可能已损坏.它们存在于/ etc / ssh /目录中.您可以删除它们并重新启动sshd,它将重新生成它们.如果出现错误,请使用以下命令
$ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key $ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key $ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key $/etc/init.d/sshd start