{"id":8578,"date":"2021-03-22T10:05:01","date_gmt":"2021-03-22T09:05:01","guid":{"rendered":"https:\/\/assistance.groupemagiconline.com\/?post_type=ht_kb&#038;p=8578"},"modified":"2022-09-28T09:07:15","modified_gmt":"2022-09-28T07:07:15","slug":"generer-une-cle-ssh","status":"publish","type":"ht_kb","link":"https:\/\/assistance.groupemagiconline.com\/en\/knowledge-base\/generer-une-cle-ssh\/","title":{"rendered":"Generate an SSH key"},"content":{"rendered":"<p style=\"text-align: justify;\">In this guide, we will see how to generate an SSH key.<\/p>\n<h2 style=\"text-align: justify;\">Why generate an SSH key?<\/h2>\n<p style=\"text-align: justify;\">The public SSH key authentication method has many advantages.<br \/>\nThe idea is to set up a tunnel between a client and a server that guarantees secure transactions.<br \/>\nThe digital fingerprint of the used password is saved on the public SSH key.<br \/>\nThe private SSH key is stored on the personal computer and therefore remains secret.<br \/>\nEven if unauthorized third parties manage to gain access to the public key, it would be almost impossible for them to decrypt the private key.<br \/>\nThus, by relying on an SSH connection with a private key and a public key, the system exchanges data in a secure manner.<\/p>\n<p style=\"text-align: justify;\">Our backup tool <a href=\"https:\/\/assistance.groupemagiconline.com\/en\/knowledge-base\/gerer-mon-abonnement-drivincloud\/\" target=\"_blank\" rel=\"noopener\">DrivinCloud<\/a> allows to use SSH keys for secure data repository.<\/p>\n<h2 style=\"text-align: justify;\">SSH key under WINDOWS<\/h2>\n<p style=\"text-align: justify;\">First press the Windows key + r on your keyboard at the same time, to open the run window.<br \/>\nThen enter <strong>cmd<\/strong> in the input field, then click on <strong>OK<\/strong>.<br \/>\nThen access in the path C:\\UsersYourWindowsUser, via the command <strong>cd <span class=\"hljs-variable\">%userprofile%.<\/span><\/strong><br \/>\nExecute the following commands respectively:<br \/>\n<strong>mkdir .ssh<\/strong><br \/>\n<strong>cd .ssh<\/strong><br \/>\n<strong>ssh-keygen<\/strong><br \/>\nPut the file name. In this case the system inserts the key in the file.<br \/>\nPut a passphrase (twice).<\/p>\n<pre><a href=\"https:\/\/assistance.groupemagiconline.com\/wp-content\/uploads\/2021\/03\/generer-une-cle-ssh-1.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-8583\" src=\"https:\/\/assistance.groupemagiconline.com\/wp-content\/uploads\/2021\/03\/generer-une-cle-ssh-1.png\" alt=\"\" width=\"682\" height=\"486\" srcset=\"https:\/\/assistance.groupemagiconline.com\/wp-content\/uploads\/2021\/03\/generer-une-cle-ssh-1.png 682w, https:\/\/assistance.groupemagiconline.com\/wp-content\/uploads\/2021\/03\/generer-une-cle-ssh-1-300x214.png 300w, https:\/\/assistance.groupemagiconline.com\/wp-content\/uploads\/2021\/03\/generer-une-cle-ssh-1-50x36.png 50w, https:\/\/assistance.groupemagiconline.com\/wp-content\/uploads\/2021\/03\/generer-une-cle-ssh-1-60x43.png 60w, https:\/\/assistance.groupemagiconline.com\/wp-content\/uploads\/2021\/03\/generer-une-cle-ssh-1-100x71.png 100w\" sizes=\"(max-width: 682px) 100vw, 682px\" \/><\/a><\/pre>\n<p style=\"text-align: justify;\">It is possible to run the same commands using PowerShell.<\/p>\n<pre><a href=\"https:\/\/assistance.groupemagiconline.com\/wp-content\/uploads\/2021\/03\/generer-une-cle-ssh-2.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-8584\" src=\"https:\/\/assistance.groupemagiconline.com\/wp-content\/uploads\/2021\/03\/generer-une-cle-ssh-2.png\" alt=\"\" width=\"685\" height=\"512\" srcset=\"https:\/\/assistance.groupemagiconline.com\/wp-content\/uploads\/2021\/03\/generer-une-cle-ssh-2.png 685w, https:\/\/assistance.groupemagiconline.com\/wp-content\/uploads\/2021\/03\/generer-une-cle-ssh-2-300x224.png 300w, https:\/\/assistance.groupemagiconline.com\/wp-content\/uploads\/2021\/03\/generer-une-cle-ssh-2-50x37.png 50w, https:\/\/assistance.groupemagiconline.com\/wp-content\/uploads\/2021\/03\/generer-une-cle-ssh-2-60x45.png 60w, https:\/\/assistance.groupemagiconline.com\/wp-content\/uploads\/2021\/03\/generer-une-cle-ssh-2-100x75.png 100w\" sizes=\"(max-width: 685px) 100vw, 685px\" \/><\/a><\/pre>\n<p style=\"text-align: justify;\">Then access the .ssh folder created under the directory C:UserYourWindowsUser. There will be two files in it. One that contains the private key, the other contains the public key.<br \/>\nThen open the file mondomainekey.pub (which contains the public key) with NotePad or BlocNote or another text editor. Copy the key that starts with <strong>ssh-rsa<\/strong>and ends with <strong>YourUser@YourWindowsUser.<\/strong><br \/>\n<strong>The key must not contain any line breaks.<\/strong><\/p>\n<pre><a href=\"https:\/\/assistance.groupemagiconline.com\/wp-content\/uploads\/2021\/03\/generer-une-cle-ssh-3.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-8585\" src=\"https:\/\/assistance.groupemagiconline.com\/wp-content\/uploads\/2021\/03\/generer-une-cle-ssh-3.png\" alt=\"\" width=\"1164\" height=\"192\" srcset=\"https:\/\/assistance.groupemagiconline.com\/wp-content\/uploads\/2021\/03\/generer-une-cle-ssh-3.png 1164w, https:\/\/assistance.groupemagiconline.com\/wp-content\/uploads\/2021\/03\/generer-une-cle-ssh-3-300x49.png 300w, https:\/\/assistance.groupemagiconline.com\/wp-content\/uploads\/2021\/03\/generer-une-cle-ssh-3-1024x169.png 1024w, https:\/\/assistance.groupemagiconline.com\/wp-content\/uploads\/2021\/03\/generer-une-cle-ssh-3-768x127.png 768w, https:\/\/assistance.groupemagiconline.com\/wp-content\/uploads\/2021\/03\/generer-une-cle-ssh-3-50x8.png 50w, https:\/\/assistance.groupemagiconline.com\/wp-content\/uploads\/2021\/03\/generer-une-cle-ssh-3-60x10.png 60w, https:\/\/assistance.groupemagiconline.com\/wp-content\/uploads\/2021\/03\/generer-une-cle-ssh-3-100x16.png 100w\" sizes=\"(max-width: 1164px) 100vw, 1164px\" \/><\/a><\/pre>\n<h2 style=\"text-align: justify;\">Create the key in Mac OS<\/h2>\n<p style=\"text-align: justify;\">First open a terminal and run the following command:<br \/>\n<strong>ssh-keygen -t rsa -C votreadresse@mail.tld<\/strong><br \/>\nthen<br \/>\n<strong>cat \/Users\/myuser\/.ssh\/id_rsa.pub<\/strong> to recover the public key.<\/p>\n<pre><a href=\"https:\/\/assistance.groupemagiconline.com\/wp-content\/uploads\/2021\/03\/generer-une-cle-ssh-4.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-8586\" src=\"https:\/\/assistance.groupemagiconline.com\/wp-content\/uploads\/2021\/03\/generer-une-cle-ssh-4.png\" alt=\"\" width=\"1210\" height=\"718\" srcset=\"https:\/\/assistance.groupemagiconline.com\/wp-content\/uploads\/2021\/03\/generer-une-cle-ssh-4.png 1210w, https:\/\/assistance.groupemagiconline.com\/wp-content\/uploads\/2021\/03\/generer-une-cle-ssh-4-300x178.png 300w, https:\/\/assistance.groupemagiconline.com\/wp-content\/uploads\/2021\/03\/generer-une-cle-ssh-4-1024x608.png 1024w, https:\/\/assistance.groupemagiconline.com\/wp-content\/uploads\/2021\/03\/generer-une-cle-ssh-4-768x456.png 768w, https:\/\/assistance.groupemagiconline.com\/wp-content\/uploads\/2021\/03\/generer-une-cle-ssh-4-50x30.png 50w, https:\/\/assistance.groupemagiconline.com\/wp-content\/uploads\/2021\/03\/generer-une-cle-ssh-4-60x36.png 60w, https:\/\/assistance.groupemagiconline.com\/wp-content\/uploads\/2021\/03\/generer-une-cle-ssh-4-100x59.png 100w\" sizes=\"(max-width: 1210px) 100vw, 1210px\" \/><\/a><\/pre>\n<h2 style=\"text-align: justify;\">Generate a key under LINUX<\/h2>\n<p style=\"text-align: justify;\">All you need to do is :<br \/>\nFirst run the ssh-keygen command on a terminal.<br \/>\nThen indicate the file name in which the key will be inserted.<br \/>\nPut a passphrase (twice).<br \/>\nRun the command <strong>cat filename.pub<\/strong> to copy the generated public key.<\/p>\n<pre><a href=\"https:\/\/assistance.groupemagiconline.com\/wp-content\/uploads\/2021\/03\/generer-une-cle-ssh-5.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-8587\" src=\"https:\/\/assistance.groupemagiconline.com\/wp-content\/uploads\/2021\/03\/generer-une-cle-ssh-5.png\" alt=\"\" width=\"778\" height=\"571\" srcset=\"https:\/\/assistance.groupemagiconline.com\/wp-content\/uploads\/2021\/03\/generer-une-cle-ssh-5.png 778w, https:\/\/assistance.groupemagiconline.com\/wp-content\/uploads\/2021\/03\/generer-une-cle-ssh-5-300x220.png 300w, https:\/\/assistance.groupemagiconline.com\/wp-content\/uploads\/2021\/03\/generer-une-cle-ssh-5-768x564.png 768w, https:\/\/assistance.groupemagiconline.com\/wp-content\/uploads\/2021\/03\/generer-une-cle-ssh-5-50x37.png 50w, https:\/\/assistance.groupemagiconline.com\/wp-content\/uploads\/2021\/03\/generer-une-cle-ssh-5-60x44.png 60w, https:\/\/assistance.groupemagiconline.com\/wp-content\/uploads\/2021\/03\/generer-une-cle-ssh-5-100x73.png 100w\" sizes=\"(max-width: 778px) 100vw, 778px\" \/><\/a><\/pre>\n<p style=\"text-align: justify;\"><strong>The key must not contain any line breaks.<\/strong><\/p>","protected":false},"excerpt":{"rendered":"<p>In this guide, we will see how to generate an SSH key. Why generate an SSH key? The public SSH key authentication method has many advantages. The idea is to set up a tunnel between a client and a server that guarantees secure transactions. The digital fingerprint of the...<\/p>","protected":false},"author":52,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"ht-kb-category":[20,21],"ht-kb-tag":[1123,1129,1130,1128,1127,1122,1103,1131,1105,1126],"class_list":["post-8578","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-hebergements-web","ht_kb_category-hebergements-dedies","ht_kb_tag-cle-privee","ht_kb_tag-cle-privee-et-cle-publique","ht_kb_tag-cle-privee-et-cle-publique-ssh","ht_kb_tag-cle-privee-et-publique","ht_kb_tag-cle-publique-ssh","ht_kb_tag-cle-ssh","ht_kb_tag-cle-ssh-linux","ht_kb_tag-cle-ssh-mac","ht_kb_tag-cle-ssh-mac-os","ht_kb_tag-cle-ublique-ssh"],"_links":{"self":[{"href":"https:\/\/assistance.groupemagiconline.com\/en\/wp-json\/wp\/v2\/ht-kb\/8578","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/assistance.groupemagiconline.com\/en\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/assistance.groupemagiconline.com\/en\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/assistance.groupemagiconline.com\/en\/wp-json\/wp\/v2\/users\/52"}],"replies":[{"embeddable":true,"href":"https:\/\/assistance.groupemagiconline.com\/en\/wp-json\/wp\/v2\/comments?post=8578"}],"version-history":[{"count":2,"href":"https:\/\/assistance.groupemagiconline.com\/en\/wp-json\/wp\/v2\/ht-kb\/8578\/revisions"}],"predecessor-version":[{"id":10974,"href":"https:\/\/assistance.groupemagiconline.com\/en\/wp-json\/wp\/v2\/ht-kb\/8578\/revisions\/10974"}],"wp:attachment":[{"href":"https:\/\/assistance.groupemagiconline.com\/en\/wp-json\/wp\/v2\/media?parent=8578"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/assistance.groupemagiconline.com\/en\/wp-json\/wp\/v2\/ht-kb-category?post=8578"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/assistance.groupemagiconline.com\/en\/wp-json\/wp\/v2\/ht-kb-tag?post=8578"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}