viernes, 20 de agosto de 2010

Ssh login sin password con OpenSSH



Un post pendiente de documentacion sobretodo

Cuando se quiere acceder a un servidor desde una pc

Para habilitar el logueo automatico se necesita crear un par de llaves (pair of keys), para ello usaremos el comando

debian:~$ ssh-keygen -t rsa

Generating public/private rsa key pair.
Enter file in which to save the key (/home/user/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/user/.ssh/id_rsa.
Your public key has been saved in /home/user/.ssh/id_rsa.pub.
The key fingerprint is:
c8:0a:cd:ec:51:6b:cc:12:77:39:44:b5:e1:ef:82:6a user@localhost
The key's randomart image is:
+--[ RSA 2048]----+
| .o.o |
| . o o |
| . o + o |
| + B + . . |
| . * B S . |
| o = . . |
| o . . . |
| E. . |
| .. |
+-----------------+

debian:~/.ssh$ ls
id_rsa id_rsa.pub known_hosts

Luego copiar el archivo id_rsa.pub al server que deseamos accesar sin el password.

debian:~/.ssh$ ssh-copy-id -i id_rsa.pub user@server

La cuestion seria si el puerto ssh a sido modificado ya no al 22 default sino otro cualquiera ej 31, la modificacion seria:

debian:~/.ssh$ ssh-copy-id -i id_rsa.pub “user@server -p 31″

Fuente:
http://www.debian-administration.org/articles/152
http://blackhold.nusepas.com/2010/04/login-ssh-por-shared-key-rsync-con-puerto-ssh-22/

No hay comentarios.: