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