Para la generación de una pareja de claves pública-privada
se realiza ejecutando en el cliente ssh-keygen
:
$ 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: xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx user@machine
Las claves se almacenan por defecto en ~/.ssh/
,
quedando el directorio así:
$ ls -l total 12 -rw------- 1 user user 883 2005-08-13 14:16 id_rsa -rw-r--r-- 1 user user 223 2005-08-13 14:16 id_rsa.pub -rw-r--r-- 1 user user 1344 2005-08-04 02:14 known_hosts
Los ficheros id_rsa
e id_rsa.pub
contienen respectivamente
las claves privada y pública. El
fichero known_hosts
contiene
la lista de las claves públicas de las máquinas
reconocidas.
Casiano Rodríguez León