SSH y evitar Man in the middle

10 03 2008

Supongamos que desde nuestro equipo queremos conectarnos a un Server SSH remoto y -por alguna cuestión- queremos tener plena seguridad que el server que nos pide la autenticación es quien dice ser, aquí les dejo unos simples pasos para realizarlo.

En primer lugar, estando fisicamente en el server al cual nos vamos a conectar remotamente ejecutamos:

# ssh-keygen -l

Enter file in which the key is (/root/.ssh/id_rsa): /etc/ssh/ssh_host_rsa_key.pub
1024 74:fe:fd:0b:63:2c:5c:ed:e4:29:c0:79:db:b9:47:d0 /etc/ssh/ssh_host_rsa_key.pub

Anotamos este fingerprint y luego desde nuestro equipo:

$ ssh user@xxx.yyy.xxx.zzz

The authenticity of host ’serverremoto (xxx.yyy.xxx.zzz)’ can’t be established.
RSA key fingerprint is 74:fe:fd:0b:63:2c:5c:ed:e4:29:c0:79:db:b9:AA:BB.
Are you sure you want to continue connecting (yes/no)? no
Host key verification failed.

Como vimos que son distintas no aceptamos la conexión, caso contrario:

The authenticity of host ’serverremoto (xxx.yyy.xxx.zzz)’ can’t be established.
RSA key fingerprint is 74:fe:fd:0b:63:2c:5c:ed:e4:29:c0:79:db:b9::47:d0.
Are you sure you want to continue connecting (yes/no)? yes

Y estamos tranquilos…

:wq!


Acciones

Informacion

Deje un comentario

usted puede usar estos tags : <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>