почему мои записи sshfp не совпадают?

У меня есть зона dnssec, и я хочу опубликовать ключи ssh, используя sshfp.

Итак, на хосте, на котором хранятся ключи, я запускаю:

 ssh-keygen -r localhost

что дает мне результаты:

 localhost IN SSHFP 1 1 223458a4e3f4cae23a2365a127a9fc5dbfc4df0b
 localhost IN SSHFP 1 2 cf04e11c129c465e90afc3fc68b0a9c6f256e7c3dc2f0ef0d61557f5848cc2bb

затем я поместил его в свою зону dnssec (очевидно, правильное имя хоста), отказался от зоны и проверил с помощью запроса на раскопки. Всё хорошо.

И затем ssh-запрос говорит, что что-то не так:

  stephane@luciole:~$ ssh -v -o VerifyHostKeyDNS=yes host
  OpenSSH_6.6.1, OpenSSL 1.0.1i 6 Aug 2014
  debug1: Reading configuration data /home/stephane/.ssh/config
  debug1: /home/stephane/.ssh/config line 1: Applying options for host
  debug1: Reading configuration data /etc/ssh/ssh_config
  debug1: /etc/ssh/ssh_config line 19: Applying options for *
  debug1: Connecting to host [2001:16d8:d0:205::5]
  debug1: Connection established.
  debug1: identity file /home/stephane/.ssh/id_rsa type 1
  debug1: identity file /home/stephane/.ssh/id_rsa-cert type -1
  debug1: identity file /home/stephane/.ssh/id_dsa type -1
  debug1: identity file /home/stephane/.ssh/id_dsa-cert type -1
  debug1: identity file /home/stephane/.ssh/id_ecdsa type -1
  debug1: identity file /home/stephane/.ssh/id_ecdsa-cert type -1
  debug1: identity file /home/stephane/.ssh/id_ed25519 type -1
  debug1: identity file /home/stephane/.ssh/id_ed25519-cert type -1
  debug1: Enabling compatibility mode for protocol 2.0
  debug1: Local version string SSH-2.0-OpenSSH_6.6.1p1 Debian-7
  debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6
  debug1: match: OpenSSH_6.6 pat OpenSSH_6.5*,OpenSSH_6.6* compat 0x14000000
  debug1: SSH2_MSG_KEXINIT sent
  debug1: SSH2_MSG_KEXINIT received
  debug1: kex: server->client aes128-ctr [email protected] none
  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 4d:57:c1:77:2d:cf:6b:46:d4:83:24:3c:b7:d4:0d:67
  debug1: found 4 insecure fingerprints in DNS
  debug1: mismatching host key fingerprint found in DNS
  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  @    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
  Someone could be eavesdropping on you right now (man-in-the-middle attack)!
  It is also possible that a host key has just been changed.
  The fingerprint for the ECDSA key sent by the remote host is
  4d:57:c1:77:2d:cf:6b:46:d4:83:24:3c:b7:d4:0d:67.
  Please contact your system administrator.
  Update the SSHFP RR in DNS with the new host key to get rid of this message.
  debug1: checking without port identifier
  The authenticity of host '[host] ([2001:16d8:d0:205::5])' can't be established.
  ECDSA key fingerprint is 4d:57:c1:77:2d:cf:6b:46:d4:83:24:3c:b7:d4:0d:67.
  No matching host key fingerprint found in DNS.
  Are you sure you want to continue connecting (yes/no)?

Так почему у меня есть?

Сейчас я работаю в безопасной среде, в локальной сети с прямым доступом к серверу. MITM невозможен.


person 22decembre    schedule 17.09.2014    source источник


Ответы (1)


при создании dns sshfp я не заметил, что у меня было только четыре RR sshfp, тогда как у меня есть три ключа ssh (по два sshfp на ключ).

Поэтому я возвращаюсь и генерирую один за другим sshfp в каталоге ssh и сравниваю с тем, что у меня было в dns. Оказалось, что у меня нет ключа ecdsa.

Поэтому я специально генерирую sshfp с этим ключом. Зарегистрировал его в зоне и подписал. После этого, когда я попробовал ssh-соединение с VerifyHostKeyDNS и подробным описанием, ssh сказал, что он нашел правильные отпечатки пальцев ssh!

cd /etc/ssh
ls
ssh_config
ssh_dsa_key
ssh_dsa_key.pub
...

ssh-kegen -r host -f ssh_host_ecdsa_key
person 22decembre    schedule 25.09.2014