vendredi 17 octobre 2008
[SSH] Eviter de répondre à la question "Are you sure you want to continue connecting (yes/no)? "
Par david techer, vendredi 17 octobre 2008 à 14:50 :: Linux
Lors d'une connexion par SSH, il y a souvent cette question qui apparait.
root@luxy:~#ssh oliviaWarning: the RSA host key for 'olivia' differs from the key for the IP address '192.168.2.1' Offending key for IP in /root/.ssh/known_hosts:16 Matching host key in /root/.ssh/known_hosts:21Are you sure you want to continue connecting (yes/no)?
Assez pratique comme technique pour l'éviter, il suffit d'ajouter l'option StrictHostKeyChecking=no
root@luxy:~# ssh -o StrictHostKeyChecking=no olivia
Warning: the RSA host key for 'olivia' differs from the key for the IP address '192.168.2.1'
Offending key for IP in /root/.ssh/known_hosts:16
Matching host key in /root/.ssh/known_hosts:21
root@olivia's password:
Last login: Thu Oct 16 20:54:41 2008 from luxy.davidgis.fr
Linux olivia 2.6.20-15-lowlatency #2 SMP PREEMPT Sun Apr 15 07:39:03 UTC 2007 i686
The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.
root@olivia:~#
Sinon on peut le spécifier dans son .ssh/config
root@luxy:~# echo "StrictHostKeyChecking no" >> ~/.ssh/config root@luxy:~# ssh olivia Warning: the RSA host key for 'olivia' differs from the key for the IP address '192.168.2.1' Offending key for IP in /root/.ssh/known_hosts:16 Matching host key in /root/.ssh/known_hosts:21 root@olivia's password:
Bingo !!!


!!!
!
... Du coup j'en ai profité pour prendre un café à la caféteria.On m'a rappelé pour aller les rejoindre sur mon porable. Sur la route malgré les indication fournies, je me suis gourré de route! J'ai du rappeler pour retrouver ma route. Je suis arrivé finalement à destination mais avec 45 minutes de retard...