Como tener acceso de un servidor a otro vía SSH sin tener que escribir usuario y password. 1) En el servidor origen ejecutar la siguiente línea de comandos en la shell (no introducir passphrase) : origen# ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/home/a/.ssh/id_rsa): Created directory '/home/a/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/a/.ssh/id_rsa. Your public key has been saved in /home/a/.ssh/id_rsa.pub. The key fingerprint is: 3e:4f:05:79:3a:9f:96:7c:3b:ad:e9:58:37:bc:37:e4 a@A Con este comando creamos las llaves publica y privada de autenticación. 2) En el servidor de destino, creamos, en caso de que no exista, la carpeta ~/.ssh destino# mkdir ~/.ssh 3) Finalmente, introducimos la llave pública del servidor origen en el fichero de llaves autorizadas del servidor destino: El siguiente comando añade nuestra llave pública en el final del fichero authorized_keys del servidor destino: origen# cat .ssh/id_rsa.pub | ssh usuario@servidordestino 'cat >> .ssh/authorized_keys' Nota: En este comando nos pedirá la clave al ejecutar un SSH, no obstante, será la última vez pues después ya estará la llave dentro de .ssh/authorized_keys 4) Ya podemos acceder vía ssh sin clave: origen# ssh usuario@servidordestino PLUS+ ACTUALIZAR LLAVE SSH AVECES PASA ESTO $ ssh secrethost @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ [...] Offending key in /home/ccm/.ssh/known_hosts:63 [...] Host key verification failed. LA SOLUCION ES MAS FACIL SOLO TENES QUE PONER [ccm@hasung:255:/etc/ssh]$ ssh-keygen -R secrethost /home/ccm/.ssh/known_hosts updated. Original contents retained as /home/ccm/.ssh/known_hosts.old [ccm@hasung:0:/etc/ssh]$ ssh secrethost The authenticity of host 'secrethost (1.2.3.4)' can't be established. RSA key fingerprint is abef:abef:abef:abef:abef:ab. Are you sure you want to continue connecting (yes/no)? FACIL LA SINTAXIS SSH-KEYGEN -R SOLUCIONA TODO SALUDOS
Login SSH sin pass + Update key
Datos archivados del Taringa! original
72puntos
0visitas
0comentarios
Actividad nueva en Posteamelo
0puntos
2visitas
0comentarios
Dar puntos: