LINUX comment s’authentifier en SSH avec une clé

On génère 2 clés
Une privée: id_rsa pour le client ^^
Une public: id_rsa.pub pour le serveur

debian:~$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/hio/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in id_rsa.
Your public key has been saved in id_rsa.pub.
The key fingerprint is:
0b:97:e8:18:78:50:f8:3b:c9:41:ba:f3:6d:4b:41:b9 hio@debian
The key's randomart image is:
+--[ RSA 2048]----+
|   ..            |
|  ...  .         |
|  .+  o          |
|  .oo. o .       |
|  .oo+E S        |
|  o.=+ + .       |
|   o.oo .        |
|    ..o          |
|     ...         |
+-----------------+

On se retrouve donc avec 2 fichiers contenant les clés :O

debian:~$ ls -l ~/.ssh/
total 8
-rw------- 1 hio hio 1675 mar  6 12:41 id_rsa
-rw-r--r-- 1 hio hio  392 mar  6 12:41 id_rsa.pub

ensuite

debian:~$ ssh-copy-id -i ~/.ssh/id_rsa.pub "-p port username@host.com"

et voilà

Comments are closed.