ssh 连接在“debug1: SSH2_MSG_KEXINIT sent"处停止 [英] ssh connection stop at "debug1: SSH2_MSG_KEXINIT sent"

查看:121
本文介绍了ssh 连接在“debug1: SSH2_MSG_KEXINIT sent"处停止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将 ssh 端口号从 22 更改为 2222之前设置的默认 ssh 端口 22 连接没问题我已经在路由器上正确映射了 NAT

I've changed ssh port number from 22 to 2222 The previous setup connection to default ssh port 22 is fine I've Mapped the NAT on the router correctly

当我尝试调试时

ssh -v -p2222 www.example.com

我挂起这个错误

debug1: SSH2_MSG_KEXINIT

以下是所有调试日志

bob@server:~$ ssh -v -p2222 www.example.com
OpenSSH_4.7p1 Debian-8ubuntu1.2, OpenSSL 0.9.8g 19 Oct 2007
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to www.example.com [100.100.100.100] port 2222.
debug1: Connection established.
debug1: identity file /home/bob/.ssh/identity type -1
debug1: identity file /home/bob/.ssh/id_rsa type -1
debug1: identity file /home/bob/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_4.7p1 Debian-8ubuntu1.2
debug1: match: OpenSSH_4.7p1 Debian-8ubuntu1.2 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.7p1 Debian-8ubuntu1.2
debug1: SSH2_MSG_KEXINIT sent
Connection closed by 100.100.100.100

就像那个连接被关闭一样我在网络内外的几台机器上使用了 gnome-terminal、putty、securecrt仍然都得到同样的错误

Just like that connection get closed i used gnome-terminal, putty, securecrt on couple machines in and outside the network still all get the same error

推荐答案

我刚刚在 XEN 主机上遇到了这种情况.我从另一个主机复制了这个主机,按照惯例,我在这样做后删除了/etc/ssh 中的主机密钥,以为稍后会生成新的.但这从未发生过,并且 sshd 很高兴在没有主机密钥的情况下启动.尝试通过 ssh 连接到此主机时,它会在 SSH2_MSG_KEXINIT 后退出.我所要做的就是创建主机密钥,在基于 debian 的机器上是这样完成的:

I just had this happen to me on a XEN host. I had duplicated this host from another, and as is common practice, I deleted the host keys in /etc/ssh after doing this, thinking that new ones would be generated later. But this never happened, and sshd happily started up with no host keys. When attempting to ssh to this host, it would drop out after SSH2_MSG_KEXINIT. All I had to do was create the host keys, which on debian based machine is done this way:

dpkg-reconfigure openssh-server

这篇关于ssh 连接在“debug1: SSH2_MSG_KEXINIT sent"处停止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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