我想從另一臺Linux機器ssh到我自己的筆記本電腦(Ubuntu 14.04)。我收到錯誤「Connection closed by IP
」,其中IP
是我的筆記本電腦的IP地址。下面是詳細的輸出($HOME
是主目錄):ssh:連接關閉IP後,SSH2_MSG_KEXINIT發送
$ ssh [email protected]_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.6.1p1 Ubuntu的2ubuntu2.8
的sshd_config:
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
之後發生?如何解決這個問題?
謝謝你真誠的!
爲什麼你認爲這將解決這個問題? – zkytony
因爲我試過了,它對我很有用 –