고쳐 쓰다:

고쳐 쓰다:

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

관련 정보