Problema:
Ao conectar-se pela primeira vez a um servidor SSH, o OpenSSH Client solicita a confirmação da autenticidade do servidor verificando sua impressão digital:
$ ssh -o UserKnownHostsFile="/tmp/authtest" -o CheckHostIP=no -l user -p 22 169.254.0.2
The authenticity of host '169.254.0.2 (169.254.0.2)' can't be established.
ECDSA key fingerprint is SHA256:jCl+n/PrVUuU5WxXFX+hg05a98Ih2LHcPcwqnHi6CuA.
Are you sure you want to continue connecting (yes/no/[fingerprint])?
Ao lado yes
e recentemente foi adicionadano
uma terceira opção (ie ). Infelizmente, esta terceira opção ainda não foi documentada . A ideia por trás dessa terceira opção é fornecer a impressão digital (que foi recebida fora de banda) para o cliente continuar.[fingerprint]
Não consegui fazer esta terceira opção funcionar:
$ ssh-keyscan 169.254.0.2
# 169.254.0.2:22 SSH-2.0-OpenSSH_7.9p1 Debian-10+deb10u1
169.254.0.2 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBGnvY9+cwo8BSGgeT2O5RjH5UMZBbAApIG+Py4T9/b0mf0EUiMP9u6fVi9x3ebLrhn1E2rytq1AD6TPRduzw+nA=
# 169.254.0.2:22 SSH-2.0-OpenSSH_7.9p1 Debian-10+deb10u1
169.254.0.2 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC9x/X2yDAdEROoeqQGXk+MJFuk0qUtDNiI7Oxigk66RfTZEjhHnKix4X+ZF/l5FOzcdxivwvSckiMEqW78vZ3YfZx4kSbnMnIQnny5mgnIo3U10oBe86KGq8OZX7yilovQp5j0m+M4WtIt3qtAk02KYsLEkxnLAVoO0H+5rTmIxpjsX/SLgkJ2FjE1WvUiPEL8l1+z50/RDrVkfiwsvzSmmjrV5A70BhonFHmDO1wCNlivuAIR4GW0tKgefn4LLwK9MJjIQj6fPxAR0W28SV79kd17RIoTezbXrxku5OTx5zvnRLKltkJoW2d/7jSvnD/OyjfZJLqACVRQvhQmYp3L
# 169.254.0.2:22 SSH-2.0-OpenSSH_7.9p1 Debian-10+deb10u1
169.254.0.2 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAgkzMtRx0jXgzyU7mBbS8fZoCk2Ky+PoZsDnmhQUOwI
$ ssh -o UserKnownHostsFile="/tmp/testkeys" -o CheckHostIP=no -l user -p 22 169.254.0.2
The authenticity of host '169.254.0.2 (169.254.0.2)' can't be established.
ECDSA key fingerprint is SHA256:jCl+n/PrVUuU5WxXFX+hg05a98Ih2LHcPcwqnHi6CuA.
Are you sure you want to continue connecting (yes/no/[fingerprint])? SHA256:jCl+n/PrVUuU5WxXFX+hg05a98Ih2LHcPcwqnHi6CuA.
Please type 'yes', 'no' or the fingerprint: [SHA256:jCl+n/PrVUuU5WxXFX+hg05a98Ih2LHcPcwqnHi6CuA.]
Please type 'yes', 'no' or the fingerprint: jCl+n/PrVUuU5WxXFX+hg05a98Ih2LHcPcwqnHi6CuA.
Please type 'yes', 'no' or the fingerprint: [jCl+n/PrVUuU5WxXFX+hg05a98Ih2LHcPcwqnHi6CuA.]
Please type 'yes', 'no' or the fingerprint: AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBGnvY9+cwo8BSGgeT2O5RjH5UMZBbAApIG+Py4T9/b0mf0EUiMP9u6fVi9x3ebLrhn1E2rytq1AD6TPRduzw+nA=
Please type 'yes', 'no' or the fingerprint: [AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBGnvY9+cwo8BSGgeT2O5RjH5UMZBbAApIG+Py4T9/b0mf0EUiMP9u6fVi9x3ebLrhn1E2rytq1AD6TPRduzw+nA=]
Please type 'yes', 'no' or the fingerprint: ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBGnvY9+cwo8BSGgeT2O5RjH5UMZBbAApIG+Py4T9/b0mf0EUiMP9u6fVi9x3ebLrhn1E2rytq1AD6TPRduzw+nA=
Please type 'yes', 'no' or the fingerprint: [ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBGnvY9+cwo8BSGgeT2O5RjH5UMZBbAApIG+Py4T9/b0mf0EUiMP9u6fVi9x3ebLrhn1E2rytq1AD6TPRduzw+nA=]
Pergunta:
Como/em que formato devo fornecer a impressão digital ao cliente SSH?
Informação adicional:
Versão do cliente SSH:
$ ssh -V
OpenSSH_8.1p1 Debian-1, OpenSSL 1.1.1d 10 Sep 2019
Chave pública do servidor:
ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBGnvY9+cwo8BSGgeT2O5RjH5UMZBbAApIG+Py4T9/b0mf0EUiMP9u6fVi9x3ebLrhn1E2rytq1AD6TPRduzw+nA= root@debian
Chave privada do servidor (não entre em pânico - a chave foi gerada apenas para esta pergunta):
-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAaAAAABNlY2RzYS
1zaGEyLW5pc3RwMjU2AAAACG5pc3RwMjU2AAAAQQRp72PfnMKPAUhoHk9juUYx+VDGQWwA
KSBvj8uE/f29Jn9BFIjD/bun1Yvcd3my64Z9RNq8ratQA+kz0Xbs8PpwAAAAqN7iWqPe4l
qjAAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBGnvY9+cwo8BSGge
T2O5RjH5UMZBbAApIG+Py4T9/b0mf0EUiMP9u6fVi9x3ebLrhn1E2rytq1AD6TPRduzw+n
AAAAAgOFpyGXQLAz/A9uBxx4KkbDSZ/ZDUTwt3bsVYUr2hxhgAAAALcm9vdEBkZWJpYW4B
AgMEBQ==
-----END OPENSSH PRIVATE KEY-----
O ponto não faz parte da impressão digital.
Então a resposta deveria ser: