{"id":281,"date":"2021-06-23T11:40:35","date_gmt":"2021-06-23T11:40:35","guid":{"rendered":"https:\/\/www.knownhost.com\/kb\/?p=281"},"modified":"2021-12-01T06:41:57","modified_gmt":"2021-12-01T12:41:57","slug":"ssh-key-generation","status":"publish","type":"post","link":"https:\/\/www.knownhost.com\/kb\/ssh-key-generation\/","title":{"rendered":"SSH Key Generation"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 ez-toc-wrap-right counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #212121;color:#212121\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #212121;color:#212121\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 eztoc-toggle-hide-by-default' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.knownhost.com\/kb\/ssh-key-generation\/#creating_an_ssh_key\" >Creating an SSH Key<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.knownhost.com\/kb\/ssh-key-generation\/#windows\" >Windows<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.knownhost.com\/kb\/ssh-key-generation\/#providing_the_public_ssh_key_to_support\" >Providing the Public SSH Key to Support<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.knownhost.com\/kb\/ssh-key-generation\/#linux\" >Linux<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n\n<p>What is Secure Shell?<\/p>\n\n\n\n<p><em><strong>S<\/strong>ecure&nbsp;<strong>SH<\/strong>ell (SSH), sometimes known as Secure Socket Shell, is a UNIX-based command interface and protocol for securely getting access to a remote computer. It is widely used by network and systems administrators to control Web and other kinds of servers remotely.<\/em><\/p>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"creating_an_ssh_key\"><\/span>Creating an SSH Key<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>It is simple to create an SSH key for use on our Services. The following is a guide for creating an SSH key for use with our Services for Windows and Linux. We do not have any Mac devices so we do not have a guide for you, unfortunately.<\/p>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"windows\"><\/span>Windows<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Download PuTTYgen from&nbsp;<a href=\"https:\/\/www.chiark.greenend.org.uk\/~sgtatham\/putty\/latest.html\">Putty Download Page<\/a>. Please use the latest version only and remember, update your PuTTY, PuTTYgen installation from time to time!<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Download and start the puttygen.exe generator that you downloaded above\u2026<\/li><li>In the &#8220;Parameters&#8221; section choose SSH2 RSA, preferably for SSH version 2 and press Generate.<\/li><li>Move your mouse randomly in the small screen in order to generate the key pairs.<\/li><li>Enter a key comment, which will identify the key (useful when you use several SSH keys).<\/li><li>Type in the passphrase and confirm it. The passphrase is used to protect your key. You will be asked for it when you connect via SSH. This is optional, as it is perfectly fine to not enter a password, opting to use password-less SSH keys.<\/li><li>Click &#8220;Save private key&#8221; to save your private key.<\/li><li>Click &#8220;Save public key&#8221; to save your public key.<\/li><\/ol>\n\n\n\n<p>Congratulations, you&#8217;ve created your SSH key for use with our Services!<\/p>\n\n\n\n<p>Next, learn how to use <a href=\"https:\/\/www.knownhost.com\/kb\/how-to-connect-with-ssh\/\">SSH to connect to KnownHost servers<\/a>.<\/p>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"providing_the_public_ssh_key_to_support\"><\/span>Providing the Public SSH Key to Support<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>If you&#8217;ve not closed PuTTYgen already, you&#8217;ll see the option to&nbsp;<strong>Load an existing private key file<\/strong>&nbsp;with a button labelled&nbsp;<strong>Load<\/strong>.<\/p>\n\n\n\n<p>Click that button and navigate to where your saved private key is. It will then show you the public key to install on your server.<\/p>\n\n\n\n<p>It will typically be prefixed by&nbsp;<strong>ssh-rsa AAAA[LONGSTRINGOFCODE]<\/strong>.<\/p>\n\n\n\n<p>Highlight it, copy it to a text file and save it on your computer. You will need it to install on the server and authenticate yourself properly.<\/p>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"linux\"><\/span>Linux<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>It is assumed that you have some Linux command-line knowledge. If not, the steps are as follows\u2026<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Open Terminal in your preferred distribution.<\/li><li>Run the below commands to generate an SSH key.<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>  ssh-keygen -t rsa -b 4096 -C \"your_email@example.com\"\n  # Creates a new ssh key, using the provided email as a label\n  Generating public\/private rsa key pair.<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>When you&#8217;re prompted to &#8220;Enter a file in which to save the key,&#8221; press Enter. This accepts the default file location.<ul><li>Save it in a location that you can easily reach, in which to save the key The default is usually `\/home\/example\/.ssh\/id_rsa` where `example` is your account username. Our recommendation is to simply accept the default by pressing enter.<\/li><\/ul><\/li><li>At the prompt, type a secure passphrase, as you might see in the following example<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>  Enter passphrase (empty for no passphrase): &#91;Type a passphrase]\n  Enter same passphrase again: &#91;Type passphrase again]<\/code><\/pre>\n\n\n\n<p>It&#8217;s fine if you choose not to use a password, instead using a password-less SSH key to log into our Services.<\/p>\n\n\n\n<p>Congratulations, you&#8217;ve generated your own SSH key!<\/p>\n\n\n\n<p>Once you&#8217;re ready to access our Services via SSH, you&#8217;ll be able to use<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  ssh-copy-id<\/code><\/pre>\n\n\n\n<p>For example, if you wanted to install your SSH key into your server, you can do so via<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  ssh-copy-id user@example.com<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>What is Secure Shell? Secure&nbsp;SHell (SSH), sometimes known as Secure Socket Shell, is a UNIX-based command interface and protocol for securely getting access to a remote computer. It is widely used by network and systems administrators to control Web and other kinds of servers remotely. Creating an SSH Key It is simple to create an [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[123,159,315],"class_list":["post-281","post","type-post","status-publish","format-standard","hentry","category-getting-started","tag-linux","tag-ssh","tag-ssh-keys"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>SSH Key Generation - KnownHost<\/title>\n<meta name=\"description\" content=\"Learn how to generate and set up ssh key on Windows and Linux machines for added security using KnownHost servers.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.knownhost.com\/kb\/ssh-key-generation\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SSH Key Generation - KnownHost\" \/>\n<meta property=\"og:description\" content=\"Learn how to generate and set up ssh key on Windows and Linux machines for added security using KnownHost servers.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.knownhost.com\/kb\/ssh-key-generation\/\" \/>\n<meta property=\"og:site_name\" content=\"KnownHost\" \/>\n<meta property=\"article:published_time\" content=\"2021-06-23T11:40:35+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-12-01T12:41:57+00:00\" \/>\n<meta name=\"author\" content=\"Jonathan K. W.\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jonathan K. W.\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/ssh-key-generation\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/ssh-key-generation\\\/\"},\"author\":{\"name\":\"Jonathan K. W.\",\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/#\\\/schema\\\/person\\\/3db6e20d1f33519cd68fe0ba1230a48b\"},\"headline\":\"SSH Key Generation\",\"datePublished\":\"2021-06-23T11:40:35+00:00\",\"dateModified\":\"2021-12-01T12:41:57+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/ssh-key-generation\\\/\"},\"wordCount\":534,\"keywords\":[\"linux\",\"ssh\",\"ssh-keys\"],\"articleSection\":[\"Getting Started\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/ssh-key-generation\\\/\",\"url\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/ssh-key-generation\\\/\",\"name\":\"SSH Key Generation - KnownHost\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/#website\"},\"datePublished\":\"2021-06-23T11:40:35+00:00\",\"dateModified\":\"2021-12-01T12:41:57+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/#\\\/schema\\\/person\\\/3db6e20d1f33519cd68fe0ba1230a48b\"},\"description\":\"Learn how to generate and set up ssh key on Windows and Linux machines for added security using KnownHost servers.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/ssh-key-generation\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/ssh-key-generation\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/ssh-key-generation\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SSH Key Generation\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/#website\",\"url\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/\",\"name\":\"KnownHost\",\"description\":\"KnownHost provides a comprehensive webhosting knowledge base to help answer many of your common webhosting and linux questions.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/#\\\/schema\\\/person\\\/3db6e20d1f33519cd68fe0ba1230a48b\",\"name\":\"Jonathan K. W.\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f432b99e6651fe8d1deb57a285bd84e806f1c9ae8b4c6c585d7e3a0b33789ad9?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f432b99e6651fe8d1deb57a285bd84e806f1c9ae8b4c6c585d7e3a0b33789ad9?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f432b99e6651fe8d1deb57a285bd84e806f1c9ae8b4c6c585d7e3a0b33789ad9?s=96&d=mm&r=g\",\"caption\":\"Jonathan K. W.\"},\"sameAs\":[\"https:\\\/\\\/www.knownhost.com\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"SSH Key Generation - KnownHost","description":"Learn how to generate and set up ssh key on Windows and Linux machines for added security using KnownHost servers.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.knownhost.com\/kb\/ssh-key-generation\/","og_locale":"en_US","og_type":"article","og_title":"SSH Key Generation - KnownHost","og_description":"Learn how to generate and set up ssh key on Windows and Linux machines for added security using KnownHost servers.","og_url":"https:\/\/www.knownhost.com\/kb\/ssh-key-generation\/","og_site_name":"KnownHost","article_published_time":"2021-06-23T11:40:35+00:00","article_modified_time":"2021-12-01T12:41:57+00:00","author":"Jonathan K. W.","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Jonathan K. W.","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.knownhost.com\/kb\/ssh-key-generation\/#article","isPartOf":{"@id":"https:\/\/www.knownhost.com\/kb\/ssh-key-generation\/"},"author":{"name":"Jonathan K. W.","@id":"https:\/\/www.knownhost.com\/kb\/#\/schema\/person\/3db6e20d1f33519cd68fe0ba1230a48b"},"headline":"SSH Key Generation","datePublished":"2021-06-23T11:40:35+00:00","dateModified":"2021-12-01T12:41:57+00:00","mainEntityOfPage":{"@id":"https:\/\/www.knownhost.com\/kb\/ssh-key-generation\/"},"wordCount":534,"keywords":["linux","ssh","ssh-keys"],"articleSection":["Getting Started"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.knownhost.com\/kb\/ssh-key-generation\/","url":"https:\/\/www.knownhost.com\/kb\/ssh-key-generation\/","name":"SSH Key Generation - KnownHost","isPartOf":{"@id":"https:\/\/www.knownhost.com\/kb\/#website"},"datePublished":"2021-06-23T11:40:35+00:00","dateModified":"2021-12-01T12:41:57+00:00","author":{"@id":"https:\/\/www.knownhost.com\/kb\/#\/schema\/person\/3db6e20d1f33519cd68fe0ba1230a48b"},"description":"Learn how to generate and set up ssh key on Windows and Linux machines for added security using KnownHost servers.","breadcrumb":{"@id":"https:\/\/www.knownhost.com\/kb\/ssh-key-generation\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.knownhost.com\/kb\/ssh-key-generation\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.knownhost.com\/kb\/ssh-key-generation\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.knownhost.com\/kb\/"},{"@type":"ListItem","position":2,"name":"SSH Key Generation"}]},{"@type":"WebSite","@id":"https:\/\/www.knownhost.com\/kb\/#website","url":"https:\/\/www.knownhost.com\/kb\/","name":"KnownHost","description":"KnownHost provides a comprehensive webhosting knowledge base to help answer many of your common webhosting and linux questions.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.knownhost.com\/kb\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.knownhost.com\/kb\/#\/schema\/person\/3db6e20d1f33519cd68fe0ba1230a48b","name":"Jonathan K. W.","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/f432b99e6651fe8d1deb57a285bd84e806f1c9ae8b4c6c585d7e3a0b33789ad9?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/f432b99e6651fe8d1deb57a285bd84e806f1c9ae8b4c6c585d7e3a0b33789ad9?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f432b99e6651fe8d1deb57a285bd84e806f1c9ae8b4c6c585d7e3a0b33789ad9?s=96&d=mm&r=g","caption":"Jonathan K. W."},"sameAs":["https:\/\/www.knownhost.com"]}]}},"_links":{"self":[{"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/posts\/281","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/comments?post=281"}],"version-history":[{"count":0,"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/posts\/281\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/media?parent=281"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/categories?post=281"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/tags?post=281"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}