首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ssh:在SSH2_MSG_KEXINIT发送后,由IP关闭连接

ssh:在SSH2_MSG_KEXINIT发送后,由IP关闭连接
EN

Stack Overflow用户
提问于 2016-11-04 04:44:49
回答 1查看 2.5K关注 0票数 3

我正试图从另一台linux机器上插入我自己的笔记本电脑(Ubuntu14.04)。我得到错误的“IP关闭连接”,其中IP是我的笔记本电脑的IP地址。下面是详细的输出($HOME是主目录):

代码语言:javascript
复制
$ ssh kaiyu@LAPTOP_IP -p 24 -vvv
OpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013
debug1: Reading configuration data $HOME/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 56: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to LAPTOP_IP [LAPTOP_IP] port 24.
debug1: Connection established.
debug3: Incorrect RSA1 identifier
debug3: Could not load "$HOME/.ssh/id_rsa" as a RSA1 public key
debug1: identity file $HOME/.ssh/id_rsa type 1
debug1: identity file $HOME/.ssh/id_rsa-cert type -1
debug1: identity file $HOME/.ssh/id_dsa type -1
debug1: identity file $HOME/.ssh/id_dsa-cert type -1
debug1: identity file $HOME/.ssh/id_ecdsa type -1
debug1: identity file $HOME/.ssh/id_ecdsa-cert type -1
debug1: identity file $HOME/.ssh/id_ed25519 type -1
debug1: identity file $HOME/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.8
debug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.8 pat OpenSSH_6.6.1* compat 0x04000000
debug2: fd 3 setting O_NONBLOCK
debug3: put_host_port: [LAPTOP_IP]:24
debug3: load_hostkeys: loading entries for host "[LAPTOP_IP]:24" from file "/homes/iws/qaz2wsx3/.ssh/known_hosts"
debug3: load_hostkeys: loaded 0 keys
debug1: SSH2_MSG_KEXINIT sent
Connection closed by LAPTOP_IP

我在网上找不到如何解决这个问题的方法。当我尝试在我自己的笔记本电脑上使用ssh localhost时,我得到了完全相同的调试输出,但是错误消息是Read from socket failed: Connection reset by peer

即使在调试输出中,有一行是Could not load "$HOME/.ssh/id_rsa" as a RSA1 public key,根据这个answer,这个消息是正常的。

下面是有关我的设置的一些其他信息:

OpenSSH版本:SSH-2.0-OpenSSH_6.1p1 Ubuntu-2 ubuntu2.8

sshd_config

代码语言:javascript
复制
Port 24
AuthenticationMethods publickey
# ListenAddress 192.168.1.1
HostKey /etc/ssh/ssh_host_key
ServerKeyBits 1024
LoginGraceTime 600
KeyRegenerationInterval 3600
PermitRootLogin no
IgnoreRhosts yes
IgnoreUserKnownHosts no
StrictModes yes
X11Forwarding yes
PrintMotd yes
SyslogFacility AUTH
LogLevel INFO
RhostsAuthentication no
RhostsRSAAuthentication no
RSAAuthentication yes
PasswordAuthentication yes
PermitEmptyPasswords yes

这种配置有什么问题吗?为什么会发生这个错误,为什么会在SSH2_MSG_KEXINIT sent之后发生呢?如何解决这一问题?

衷心感谢!

EN

回答 1

Stack Overflow用户

发布于 2016-11-04 04:55:43

重新安装ssh位

sudo apt-get --重新安装,安装openssh-server openssh-client

票数 -2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/40415442

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档