{"id":2051,"date":"2021-06-10T15:35:45","date_gmt":"2021-06-10T12:35:45","guid":{"rendered":"https:\/\/www.scalahosting.com\/kb\/?p=2051"},"modified":"2022-02-03T17:51:34","modified_gmt":"2022-02-03T15:51:34","slug":"how-to-generate-an-ssh-key-pair-in-mac-os","status":"publish","type":"post","link":"https:\/\/www.scalahosting.com\/kb\/how-to-generate-an-ssh-key-pair-in-mac-os\/","title":{"rendered":"How to Generate an SSH Key Pair in Mac OS"},"content":{"rendered":"<p><span style=\"font-weight: 400;\">Using <\/span><a href=\"https:\/\/www.scalahosting.com\/blog\/what-is-ssh-and-how-to-use-it\/\"><b>Secure Shell Protocol <\/b><b><i>(SSH)<\/i><\/b><\/a> <span style=\"font-weight: 400;\">i<\/span><b>s a safer way of connecting to your web hosting server. <\/b><span style=\"font-weight: 400;\">SSH uses key pairs to ensure that the right client-server duo is communicating. This method offers greater integrity over<\/span><b> a username and password authentication.<\/b><\/p>\n<p><span style=\"font-weight: 400;\">For SSH, <\/span><b>the key pair involved is a private and public key<\/b><span style=\"font-weight: 400;\">. You must generate them at the same time on the same device. The method for SSH key pair generation will vary depending on what device you are using.<\/span><\/p>\n<h2><b>SSH Key Generation on Mac OS<\/b><\/h2>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Step 1. <\/b><span style=\"font-weight: 400;\">Open the Terminal via Applications -&gt; Utilities -&gt; Terminal<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Step 2. <\/b><span style=\"font-weight: 400;\">Enter the following command: \u201cssh-keygen -t rsa\u201d<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Step 3.<\/b><span style=\"font-weight: 400;\"> Provide the location where you wish to save the generated keys. Remember to include the file name to which you want to save them. For example, <\/span><b>\u201c\/home\/username\/.ssh\/mykeys_rsa\u201d<\/b><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">If you do not wish to provide a custom location, hit enter to accept the default save location. By default, generated keys are save in<\/span><b> \u201c\/home\/yourusername\/.ssh\/\u201d<\/b><span style=\"font-weight: 400;\"> with the public and private keys named<\/span><b> \u201cid_rsa\u201d and \u201cid_rsa.pub\u201d <\/b><span style=\"font-weight: 400;\">respectively.<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Step 4. <\/b><span style=\"font-weight: 400;\">After key generation, the system will ask for a passphrase. You may skip this step by hitting the enter key. Hit the enter key again when asked to reconfirm the passphrase.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">When complete, you should see a message similar to<\/span><b> the following:<\/b><\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-2052 size-full\" src=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/06\/MacOS-keygen.jpg\" alt=\"How to Generate an SSH Key Pair in Mac OS, SSH Key Generation on Mac OS\" width=\"780\" height=\"389\" srcset=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/06\/MacOS-keygen.jpg 780w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/06\/MacOS-keygen-300x150.jpg 300w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/06\/MacOS-keygen-768x383.jpg 768w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Using Secure Shell Protocol (SSH) is a safer way of connecting to your web hosting server. SSH uses key pairs to ensure that the right client-server duo is communicating. This method offers greater integrity over a username and password authentication. For SSH, the key pair involved is a private and public key. You must generate [&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-2051","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\/2051","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=2051"}],"version-history":[{"count":4,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/posts\/2051\/revisions"}],"predecessor-version":[{"id":3111,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/posts\/2051\/revisions\/3111"}],"wp:attachment":[{"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/media?parent=2051"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/categories?post=2051"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/tags?post=2051"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}