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をこのように使用していることに驚きましたが、明らかに彼らはそれが良いアイデアだと思います。

PS:OpenSSH_for_Windows_7.7p1がこのデバイスに接続できず、サーバーが予期せず切断されたと文句を言うので、libsshサーバーが正しく実装されているのだろうか。

ベストアンサー1

おすすめ記事