我收到此错误“ssh_exchange_identification:”

我收到此错误“ssh_exchange_identification:”

直到昨天一切都运行正常,现在我突然收到此错误,如果我输入

ssh -D 9999 [email protected]
ssh_exchange_identification: Connection closed by remote host

输出如下:

OpenSSH_5.8p1 Debian-7ubuntu1, OpenSSL 1.0.0e 6 Sep 2011
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to 172.16.30.30 [172.16.30.30] port 22.
debug1: Connection established.
debug3: Incorrect RSA1 identifier
debug3: Could not load "/home/adnan/.ssh/id_rsa" as a RSA1 public key
debug2: key_type_from_name: unknown key type '-----BEGIN'
debug3: key_read: missing keytype
debug2: key_type_from_name: unknown key type 'Proc-Type:'
debug3: key_read: missing keytype
debug2: key_type_from_name: unknown key type 'DEK-Info:'
debug3: key_read: missing keytype
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug2: key_type_from_name: unknown key type '-----END'
debug3: key_read: missing keytype
debug1: identity file /home/adnan/.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/adnan/.ssh/id_rsa-cert type -1
debug1: identity file /home/adnan/.ssh/id_dsa type -1
debug1: identity file /home/adnan/.ssh/id_dsa-cert type -1
debug1: identity file /home/adnan/.ssh/id_ecdsa type -1
debug1: identity file /home/adnan/.ssh/id_ecdsa-cert type -1
ssh_exchange_identification: Connection closed by remote host

答案1

下面几行可能非常具有误导性:

debug3: Could not load "/home/adnan/.ssh/id_rsa" as a RSA1 public key
debug2: key_type_from_name: unknown key type '-----BEGIN'

根据我的经验,我可以说这个问题可能是由服务器配置引起的,即使这些消息让它看起来像是客户端密钥问题。当然,您也需要检查您的客户端配置。但如果它正常工作并且客户端上没有任何变化,请务必查看服务器配置,尽管错误消息具有误导性。

例如,我发现如果你的用户是不是服务器上的 ssh 配置允许,ssh 客户端给出完全相同(误导性)的错误消息。

sudo nano /etc/sshd_config
AllowUsers yourname@*

答案2

尝试使用该选项将密钥类型更改为 2 -2

ssh -2 -D 9999 [email protected]

当命令行选项不正确时,可能会发生此错误。

相关内容