{"id":548,"date":"2017-10-28T21:16:49","date_gmt":"2017-10-28T20:16:49","guid":{"rendered":"https:\/\/memo.xtranet.info\/?p=548"},"modified":"2018-01-22T21:48:35","modified_gmt":"2018-01-22T20:48:35","slug":"ssh-de-passe","status":"publish","type":"post","link":"https:\/\/memo.xtranet.info\/?p=548","title":{"rendered":"SSH sans mot de passe"},"content":{"rendered":"<h1><span style=\"color: #33cccc;\"><a href=\"https:\/\/memo.xtranet.info\/wp-content\/uploads\/2017\/10\/ssh.png\"><img decoding=\"async\" class=\"alignleft wp-image-551\" src=\"https:\/\/memo.xtranet.info\/wp-content\/uploads\/2017\/10\/ssh.png\" alt=\"\" width=\"134\" height=\"134\" srcset=\"https:\/\/memo.xtranet.info\/wp-content\/uploads\/2017\/10\/ssh.png 512w, https:\/\/memo.xtranet.info\/wp-content\/uploads\/2017\/10\/ssh-150x150.png 150w, https:\/\/memo.xtranet.info\/wp-content\/uploads\/2017\/10\/ssh-300x300.png 300w, https:\/\/memo.xtranet.info\/wp-content\/uploads\/2017\/10\/ssh-144x144.png 144w\" sizes=\"(max-width: 134px) 100vw, 134px\" \/><\/a>SSH sans mot de passe :<br \/>\n<\/span><\/h1>\n<p><span style=\"color: #ffffff;\">Pour se connecter d&rsquo;une machine <strong><span style=\"color: #ff9900;\">A<\/span><\/strong> sans mot de passe sur un serveur distant <strong><span style=\"color: #ff9900;\">B<\/span><\/strong>.<\/span><\/p>\n<p><strong><span style=\"color: #ff6600;\">1 :<\/span> <\/strong>Depuis le serveur <strong><span style=\"color: #ff9900;\">A<\/span><\/strong> Cr\u00e9er une cl\u00e9 publique et priv\u00e9e : ssh-keygen -b 4096 -t rsa<\/p>\n<p><strong><span style=\"color: #ff6600;\">2 :<\/span><\/strong> Se connecter depuis <strong><span style=\"color: #ff9900;\">A<\/span><\/strong> au serveur distant <span style=\"color: #ff9900;\"><strong>B<\/strong><\/span> en ssh : ssh root@IPduServeur<span style=\"color: #ff9900;\">B<\/span><\/p>\n<p><strong><span style=\"color: #ff6600;\">3 :<\/span> Depuis la machine <span style=\"color: #ff9900;\">A<\/span> : <\/strong><\/p>\n<ul>\n<li>Se mettre dans le dossier .SSH<\/li>\n<li>Copier la cl\u00e9 publique depuis <strong><span style=\"color: #ff9900;\">A<\/span><\/strong> sur le serveur distant <span style=\"color: #ff9900;\"><strong>B<\/strong><\/span> : ssh-copy-id ID_RSA.pub root@IPduServeur<\/li>\n<\/ul>\n<p><strong><span style=\"color: #ff6600;\">4 :<\/span><\/strong> Se d\u00e9connecter pour tester : ssh &lsquo;root@IPduServeur<strong><span style=\"color: #ff9900;\">B<\/span><\/strong>&lsquo;<\/p>\n<p>Mettre <em><strong><span style=\"color: #99cc00;\">600<\/span>\u00a0 <\/strong><\/em>pour l&rsquo;id_rsa<\/p>\n<p>L&rsquo;autorisation se retrouve dans le fichier .\/ssh\/authorized_keys<\/p>\n<p>Il existe un tr\u00e8s bon tuto <a href=\"https:\/\/openclassrooms.com\/courses\/reprenez-le-controle-a-l-aide-de-linux\/la-connexion-securisee-a-distance-avec-ssh\" target=\"_blank\" rel=\"noopener\">la<\/a> ou <a href=\"https:\/\/tutox.fr\/2017\/04\/08\/se-connecter-ssh-de-passe\/\" target=\"_blank\" rel=\"noopener\">ici<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>SSH sans mot de passe : Pour se connecter d&rsquo;une machine A sans mot de passe sur un serveur distant B. 1 : Depuis le serveur A Cr\u00e9er une cl\u00e9 publique et priv\u00e9e : ssh-keygen -b 4096 -t rsa 2 : Se connecter depuis A au serveur distant B en ssh : ssh root@IPduServeurB 3&#8230; <a href=\"https:\/\/memo.xtranet.info\/?p=548\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">SSH sans mot de passe<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16,4,33],"tags":[46],"class_list":["post-548","post","type-post","status-publish","format-standard","hentry","category-administration","category-linux","category-ssh","tag-ssh"],"_links":{"self":[{"href":"https:\/\/memo.xtranet.info\/index.php?rest_route=\/wp\/v2\/posts\/548","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/memo.xtranet.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/memo.xtranet.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/memo.xtranet.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/memo.xtranet.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=548"}],"version-history":[{"count":12,"href":"https:\/\/memo.xtranet.info\/index.php?rest_route=\/wp\/v2\/posts\/548\/revisions"}],"predecessor-version":[{"id":631,"href":"https:\/\/memo.xtranet.info\/index.php?rest_route=\/wp\/v2\/posts\/548\/revisions\/631"}],"wp:attachment":[{"href":"https:\/\/memo.xtranet.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=548"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/memo.xtranet.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=548"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/memo.xtranet.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=548"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}