{"id":544,"date":"2013-08-02T14:23:54","date_gmt":"2013-08-02T12:23:54","guid":{"rendered":"http:\/\/sam-soul.fr\/Info\/?p=544"},"modified":"2013-08-02T14:23:54","modified_gmt":"2013-08-02T12:23:54","slug":"authentification-par-cle-public-prive","status":"publish","type":"post","link":"http:\/\/les-fougs.com\/wordpress\/2013\/08\/02\/authentification-par-cle-public-prive\/","title":{"rendered":"Authentification par cl\u00e9 public priv\u00e9"},"content":{"rendered":"<p>Exemple : de Tic vers Tac<\/p>\n<p>Sur TIC:<\/p>\n<p><strong>cd root\/.ssh\/<\/strong><br \/>\n<strong>ssh-keygen -t dsa<\/strong><br \/>\nGenerating public\/private dsa key pair.<\/p>\n<p>Enter file in which to save the key (\/root\/.ssh\/id_dsa): <strong>\/root\/.ssh\/id_dsa_tic<\/strong><br \/>\nEnter passphrase (empty for no passphrase):<br \/>\nEnter same passphrase again:<br \/>\nYour identification has been saved in \/root\/.ssh\/id_dsa_tic.<br \/>\nYour public key has been saved in \/root\/.ssh\/id_dsa_tic.pub.<br \/>\nThe key fingerprint is:6e:82:aa:d9:c3:af:57:34:26:f8:1e:b5:24:c9:88:b9 root@ticThe key&rsquo;s randomart image is:<\/p>\n<p>+&#8211;[ DSA 1024]&#8212;-+<br \/>\n| |<br \/>\n| |<br \/>\n| o + . |<br \/>\n|o o = * |<br \/>\n| . . B oS |<br \/>\n|E o.o. |<br \/>\n| . ..o. o |<br \/>\n| oo.o o |<br \/>\n|o.+=. |<br \/>\n+&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<\/p>\n<p>root@tic:~\/.ssh# <strong>ls<\/strong><br \/>\nid_dsa_tic id_dsa_tic.pub<br \/>\nroot@tic:~\/.ssh#\u00a0<strong>chmod 600 id_dsa_tic.pub<\/strong><\/p>\n<p>root@tic:~\/.ssh# ls -la<br \/>\ntotal 20<br \/>\ndrwx&#8212;&#8212; 2 root root 4096 2013-08-02 14:04 .<br \/>\ndrwx&#8212;&#8212; 34 root root 4096 2013-05-07 16:57 ..<br \/>\n-rw&#8212;&#8212;- 1 root root 668 2013-08-02 14:04 id_dsa_tic<br \/>\n-rw&#8212;&#8212;- 1 root root 598 2013-08-02 14:04 id_dsa_tic.pub<\/p>\n<p>______________________________________________________________<\/p>\n<p>Copie de la cl\u00e9 publique sur le serveur distant (TAC).<br \/>\nroot@tic:~\/.ssh# <strong>scp id_dsa_tic.pub root@tac:\/root\/.ssh\/<\/strong><br \/>\nroot@tac&rsquo;s password:<br \/>\nid_dsa_tic.pub 100% 598 0.6KB\/s 00:00<\/p>\n<p>Sur TAC :<br \/>\nLe fichier est bien pr\u00e9sent sur TAC.<br \/>\nroot@tac:~# <strong>ll \/root\/.ssh\/<\/strong><br \/>\ntotal 16<br \/>\ndrwx&#8212;&#8212; 2 root root 4096 2013-08-02 14:17 .<br \/>\ndrwx&#8212;&#8212; 32 root root 4096 2013-08-02 10:32 ..<br \/>\n-rw&#8212;&#8212;- 1 root root 598 2013-08-02 14:17 id_dsa_tic.pub<\/p>\n<p>Ajout de la cl\u00e9 dans le fichier des cl\u00e9s autoris\u00e9es.<br \/>\nroot@tac:~# <strong>cd \/root\/.ssh\/<\/strong><br \/>\nroot@tac:~\/.ssh# <strong>cat id_dsa_tic.pub &gt;&gt; authorized_keys<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Exemple : de Tic vers Tac Sur TIC: cd root\/.ssh\/ ssh-keygen -t dsa Generating public\/private dsa key pair. Enter file in which to save the key (\/root\/.ssh\/id_dsa): \/root\/.ssh\/id_dsa_tic Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in \/root\/.ssh\/id_dsa_tic. Your public key has been saved in \/root\/.ssh\/id_dsa_tic.pub. The key &hellip; <a href=\"http:\/\/les-fougs.com\/wordpress\/2013\/08\/02\/authentification-par-cle-public-prive\/\" class=\"more-link\">Continuer la lecture<span class=\"screen-reader-text\"> de &laquo;&nbsp;Authentification par cl\u00e9 public priv\u00e9&nbsp;&raquo;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[51],"tags":[],"_links":{"self":[{"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/posts\/544"}],"collection":[{"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/comments?post=544"}],"version-history":[{"count":0,"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/posts\/544\/revisions"}],"wp:attachment":[{"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/media?parent=544"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/categories?post=544"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/les-fougs.com\/wordpress\/wp-json\/wp\/v2\/tags?post=544"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}