ssh-keyscan은 libssh 기반 서버에 키가 없다고 보고합니다.

ssh-keyscan은 libssh 기반 서버에 키가 없다고 보고합니다.

공급업체는 libssh를 장치의 SSH 서버로 사용하기로 결정했습니다.

openssh 및 putty는 문제 없이 이 장치에 연결할 수 있지만 ssh-keyscan은 어떤 키도 반환하지 않습니다.

이유를 아시나요?

centos openssh의 출력:

$ ssh -v -F /dev/null 192.168.x.y
OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 2017
debug1: Reading configuration data /dev/null
debug1: Connecting to 192.168.x.y [192.168.x.y] port 22.
debug1: Connection established.
debug1: identity file /home/user/.ssh/id_rsa type 1
-snip-
debug1: key_load_public: No such file or directory
debug1: identity file /home/user/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.4
debug1: Remote protocol version 2.0, remote software version libssh_0.7.7
debug1: no match: libssh_0.7.7
debug1: Authenticating to 192.168.x.y:22 as 'user'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: ecdh-sha2-nistp256
debug1: kex: host key algorithm: ecdsa-sha2-nistp521
debug1: kex: server->client cipher: aes128-ctr MAC: hmac-sha2-256 compression: none
debug1: kex: client->server cipher: aes128-ctr MAC: hmac-sha2-256 compression: none
debug1: kex: ecdh-sha2-nistp256 need=32 dh_need=32
debug1: kex: ecdh-sha2-nistp256 need=32 dh_need=32
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp521 SHA256:fingerprintfingerprintfingerprintfingerprin
The authenticity of host '192.168.x.y (192.168.x.y)' can't be established.
ECDSA key fingerprint is SHA256:fingerprintfingerprintfingerprintfingerprin.
ECDSA key fingerprint is MD5:00:11:22:33:44:55:66:77:88:99:aa:bb:cc:dd:ee:ff.
Are you sure you want to continue connecting (yes/no)? no
Host key verification failed.

centos ssh-keyscan의 출력:

$ ssh-keyscan -v 192.168.x.y
debug1: no match: libssh_0.7.7
# 192.168.x.y:22 SSH-2.0-libssh_0.7.7
debug1: Enabling compatibility mode for protocol 2.0
debug1: SSH2_MSG_KEXINIT sent
debug1: no match: libssh_0.7.7
# 192.168.x.y:22 SSH-2.0-libssh_0.7.7
debug1: SSH2_MSG_KEXINIT sent
debug1: no match: libssh_0.7.7
# 192.168.x.y:22 SSH-2.0-libssh_0.7.7
debug1: SSH2_MSG_KEXINIT sent

Telnet 연결 테스트의 출력:

$ telnet 192.168.x.y 22
Trying 192.168.x.y...
Connected to 192.168.x.y.
Escape character is '^]'.
SSH-2.0-libssh_0.7.7
^C
Connection closed by foreign host.

누군가가 libssh를 이렇게 사용한다는 것에 놀랐지만 분명히 그들은 그것이 좋은 생각이라고 생각합니다.

추신: OpenSSH_for_Windows_7.7p1이 이 장치에 연결할 수 없고 서버가 예기치 않게 연결을 끊었다고 불평하기 때문에 libssh 서버가 올바르게 구현되었는지 궁금합니다.

관련 정보