16 abril, 2014

SSH llaves , de la forma mas facil

ok ya me enfade de poner contraseñas que no me acuerdo mejor usare llaves

Laptop se quiere conectar a Raspberry pero Laptop odia poner contraseña :@

en Laptop:

[neo@robotech ~]$ ssh-keygen 

Generating public/private rsa key pair.
Enter file in which to save the key (/home/neo/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/neo/.ssh/id_rsa.
Your public key has been saved in /home/neo/.ssh/id_rsa.pub.
The key fingerprint is:
18:72:b0:b5:43:42:8d:74:ff:cc:43:b5:f1:46:ab:0a neo@robotech.localdomain
The key's randomart image is:
+--[ RSA 2048]----+
|      . o*+=+..  |
|       + .* o=.. |
|      + +  o..+  |
|     . -  o   |
|      . E   .    |
|      A   . .     |
|        *  .      |
|      *   *        |
|                 |
+-----------------+

luego 

[neo@robotech ~]$ ssh-copy-id neo@192.168.1.2 

/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
neo@192.168.1.2's password: 

Ponemos la poderosa!

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh neo@192.168.1.2"
and check to make sure that only the key(s) you wanted were added.


Linux 1up 3.10.25+ #622 PREEMPT Fri Jan 3 18:41:00 GMT 2014 armv6l
 ____                 _                                  _ 
|  _ \ __ _ ___ _ __ | |__   ___ _ __ _ __ _   _   _ __ (_)
| |_) / _` / __| '_ \| '_ \ / _ \ '__| '__| | | | | '_ \| |
|  _ < (_| \__ \ |_) | |_) |  __/ |  | |  | |_| | | |_) | |
|_| \_\__,_|___/ .__/|_.__/ \___|_|  |_|   \__, | | .__/|_|
               |_|                         |___/  |_|      

Last login: Wed Apr 16 20:30:04 2014 from 192.168.1.104

y ya n_n


si tienes un nombre de usuario diferente usa

[neo@localhost ~]$ ssh-add -l usuario

2048 48:23:d0:d5:43:4d:56:77:ff:cc:43:b8:f1:43:ab:0a neo@robotech.localdomain (RSA)

y ahora solo lo exportas

[neo@localhost ~]$ ssh-copy-id usuario@192.168.1.1
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys

usuario@192.168.1.1's password: 

Number of key(s) added: 1

listo



Publicar un comentario