{"id":2077,"date":"2021-06-10T15:46:57","date_gmt":"2021-06-10T12:46:57","guid":{"rendered":"https:\/\/www.scalahosting.com\/kb\/?p=2077"},"modified":"2022-02-03T17:42:39","modified_gmt":"2022-02-03T15:42:39","slug":"how-to-generate-an-ssh-key-pair-in-linux","status":"publish","type":"post","link":"https:\/\/www.scalahosting.com\/kb\/how-to-generate-an-ssh-key-pair-in-linux\/","title":{"rendered":"How to Generate an SSH Key Pair in Linux"},"content":{"rendered":"<p><a href=\"https:\/\/www.scalahosting.com\/blog\/what-is-ssh-and-how-to-use-it\/\"><b>SSH connections<\/b><\/a><span style=\"font-weight: 400;\"> allow you to create secure connections between your device and a server. They rely on public-private key pairs for this to happen. The system offers greater security compared to credential-based access methods such as <\/span><b>username and password.<\/b><\/p>\n<p><b>The generation of SSH key pairs<\/b><span style=\"font-weight: 400;\"> must be done on your device to create a set that matches your device. The process will differ slightly depending on the system used.<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">Generating an SSH Key Pair on Linux<\/span><\/h2>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-2078 size-full\" src=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/06\/Linux-keygen.jpg\" alt=\"How to Generate an SSH Key Pair in Linux, Generating an SSH Key Pair on Linux\" width=\"875\" height=\"429\" srcset=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/06\/Linux-keygen.jpg 875w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/06\/Linux-keygen-300x147.jpg 300w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/06\/Linux-keygen-768x377.jpg 768w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Step 1. <\/b><span style=\"font-weight: 400;\">Open a terminal window and type:<\/span><\/li>\n<\/ul>\n<p><b>ssh-keygen -t rsa<\/b><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Step 2.<\/b><span style=\"font-weight: 400;\"> Enter the path where you wish to save the key. The default path is <\/span><b>\u201c\/home\/username\/.ssh\/id_rsa\u201d <\/b><span style=\"font-weight: 400;\">&#8211; you can simply hit the enter key to accept this.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Step 3.<\/b><span style=\"font-weight: 400;\">&nbsp; Enter your passphrase\/password, then one more time to confirm that it is correct.&nbsp;<\/span><\/li>\n<\/ul>\n<p><b>You can locate the generated keys in the directory specified in Step 2 above.<\/b><span style=\"font-weight: 400;\"> The public key should be uploaded to your server, while the private key should be embedded in your device.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>SSH connections allow you to create secure connections between your device and a server. They rely on public-private key pairs for this to happen. The system offers greater security compared to credential-based access methods such as username and password. The generation of SSH key pairs must be done on your device to create a set [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_seopress_robots_primary_cat":"","_seopress_titles_title":"","_seopress_titles_desc":"","_seopress_robots_index":"","footnotes":""},"categories":[34],"tags":[],"class_list":["post-2077","post","type-post","status-publish","format-standard","hentry","category-web-hosting"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/posts\/2077","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/comments?post=2077"}],"version-history":[{"count":4,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/posts\/2077\/revisions"}],"predecessor-version":[{"id":3109,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/posts\/2077\/revisions\/3109"}],"wp:attachment":[{"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/media?parent=2077"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/categories?post=2077"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/tags?post=2077"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}