更新:

更新:

在新安装的 CentOS7 上看到非常奇怪的错误,我没有创建或触摸任何 ssh 密钥。~/.ssh/目录也是空的。

[john@server1 ~]$ ssh server1
key_read: type mismatch: encoding error
key_read: type mismatch: encoding error
john@server1's password:

如果我尝试,ssh localhost我不会收到该错误。会出现什么问题?

更新:

[john@server1 ~]$ ssh -vvv server1
OpenSSH_6.4, OpenSSL 1.0.1e-fips 11 Feb 2013
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 49: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to server1 [10.1.1.10] port 22.
debug1: Connection established.
debug3: Incorrect RSA1 identifier
debug3: Could not load "/home/john/.ssh/id_rsa" as a RSA1 public key
debug1: identity file /home/john/.ssh/id_rsa type 1
debug1: identity file /home/john/.ssh/id_rsa-cert type -1
debug1: identity file /home/john/.ssh/id_dsa type -1
debug1: identity file /home/john/.ssh/id_dsa-cert type -1
debug1: identity file /home/john/.ssh/id_ecdsa type -1
debug1: identity file /home/john/.ssh/id_ecdsa-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.4
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.4
debug1: match: OpenSSH_6.4 pat OpenSSH*
debug2: fd 3 setting O_NONBLOCK
debug3: load_hostkeys: loading entries for host "server1" from file "/home/john/.ssh/known_hosts"
debug3: load_hostkeys: found key type ECDSA in file /home/john/.ssh/known_hosts:2
debug3: load_hostkeys: loaded 1 keys
debug3: load_hostkeys: loading entries for host "server1" from file "/etc/ssh/ssh_known_hosts"
key_read: type mismatch: encoding error
debug3: load_hostkeys: loaded 0 keys
...
... omitted some output
...
debug2: kex_parse_kexinit: none,[email protected]
debug2: kex_parse_kexinit: none,[email protected]
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: mac_setup: found [email protected]
debug1: kex: server->client aes128-ctr [email protected] none
debug2: mac_setup: found [email protected]
debug1: kex: client->server aes128-ctr [email protected] none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ECDSA 45:9e:70:1d:89:49:d9:dd:ed:df:4b:b0:56:6e:11:31
debug3: load_hostkeys: loading entries for host "server1" from file "/home/john/.ssh/known_hosts"
debug3: load_hostkeys: found key type ECDSA in file /home/john/.ssh/known_hosts:2
debug3: load_hostkeys: loaded 1 keys
debug3: load_hostkeys: loading entries for host "server1" from file "/etc/ssh/ssh_known_hosts"
key_read: type mismatch: encoding error
debug3: load_hostkeys: loaded 0 keys
debug3: load_hostkeys: loading entries for host "10.1.1.10" from file "/home/john/.ssh/known_hosts"
debug3: load_hostkeys: found key type ECDSA in file /home/john/.ssh/known_hosts:2
debug3: load_hostkeys: loaded 1 keys
debug3: load_hostkeys: loading entries for host "10.1.1.10" from file "/etc/ssh/ssh_known_hosts"
key_read: type mismatch: encoding error
debug3: load_hostkeys: loaded 0 keys
debug1: Host 'server1' is known and matches the ECDSA host key.
debug1: Found key in /home/john/.ssh/known_hosts:2
debug1: ssh_ecdsa_verify: signature correct

根据要求,这里是文件输出。

$cat /etc/ssh/ssh_known_hosts
server1,server1,server1.example.com,10.1.1.10 ssh-dss AAAAB3NzaC1yc2EAAAADAQABAAABAQCjEZfdesyp4xtJslnXEvG0arhPAddsMFUmO/lbUoeT0p31QAnbfs3LvVc4EP/ziipJUiFZDaKeT3KB+4zmioIwR2pO67c9DDY4zTasVoZv1kL7EiHKYxNIjIMXhYMRm+MQBTiBJWW5NB9SRff/TQSBAnIcXqMZZYco1YO7b95XZR5fkO3LLE8Mr5LvuXwMNlzEu/+9vw69rxWbL+JnRJT2Ydv61h23bSL3reZ9ZvpEMVgF+DkgqxdBp9ao2GfTwLVx96E2/EnmWY2a/2KUlB9TwKGT7GI5VUcep1ia4esHid9wxXhjN/Iuw3k/VFzQSdTvIzg72DqkkPaBErxGJ83V

答案1

/etc/ssh/ssh_known_hosts正如日志所示,您有一些错误的记录。你是如何设置那个的?它是系统范围的替代方案,~/.ssh/known_hosts并且仅应在合理的情况下使用(分发、本地网络、证书)。

检查该文件中的内容,检查是否有一些不一致的地方,并可能检查其中是否有您的server1或 ip 。10.1.1.10

答案2

在进行大规模更新后,我也遇到了这个问题libssl,解决了重新启动主机的问题:

# reboot

相关内容