{"id":4543,"date":"2018-08-10T17:04:27","date_gmt":"2018-08-10T17:04:27","guid":{"rendered":"https:\/\/geekdecoder.com\/?p=4543"},"modified":"2018-08-10T17:04:27","modified_gmt":"2018-08-10T17:04:27","slug":"generate-ssh-keys-on-linux-and-use-with-putty-on-windows","status":"publish","type":"post","link":"https:\/\/www.qbytes.cloud\/index.php\/2018\/08\/10\/generate-ssh-keys-on-linux-and-use-with-putty-on-windows\/","title":{"rendered":"Generate ssh keys on linux and use with PuTTY on Windows"},"content":{"rendered":"<p>Log into the Linux server as the user you are going to use to connect with ssh. Generate the key.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">ssh-keygen -t rsa -b 4096 -C &quot;email@domain.com&quot;\nGenerating public\/private rsa key pair.\nEnter file in which to save the key (\/home\/user\/.ssh\/id_rsa): \nEnter passphrase (empty for no passphrase): \nEnter same passphrase again: \nYour identification has been saved in \/home\/user\/.ssh\/id_rsa.\nYour public key has been saved in \/home\/user\/.ssh\/id_rsa.pub.\nThe key fingerprint is:\nSHA256:3\/dDa9R+zzDpGNt\/EU9Jusj\/snbKt3+B8F+ULnxXtWk email@domain.com\nThe key&#039;s randomart image is:\n+---&#x5B;RSA 4096]----+\n|                 |\n|               ..|\n|              o *|\n|           . . E+|\n|        S . = =o=|\n|         . + * O=|\n|          . + @.*|\n|            .@ %=|\n|            ++@+#|\n+----&#x5B;SHA256]-----+\n\n<\/pre>\n<p>Now copy the id_rsa key to your Windows desktop. This can be done by copying and pasting the contents of the file or using an SCP client such as PSCP which is supplied with the PuTTY install or FileZilla.<\/p>\n<p><!--more--><\/p>\n<p>Next launch PuTTYgen from the Windows Programs list.<\/p>\n<p>Click Conversions from the PuTTY Key Generator menu and select Import key.<br \/>\nNavigate to the OpenSSH private key (id_rsa)and click Open.<br \/>\nUnder Actions \/ Save the generated key, select Save private key.<br \/>\nChoose an optional passphrase to protect the private key.<br \/>\nSave the private key to the desktop as id_rsa.ppk.<\/p>\n<p><a href=\"https:\/\/qbytes.cloud\/wp-content\/uploads\/2018\/08\/puttygen.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-4545\" src=\"https:\/\/qbytes.cloud\/wp-content\/uploads\/2018\/08\/puttygen.png\" alt=\"\" width=\"496\" height=\"478\" srcset=\"https:\/\/www.qbytes.cloud\/wp-content\/uploads\/2018\/08\/puttygen.png 496w, https:\/\/www.qbytes.cloud\/wp-content\/uploads\/2018\/08\/puttygen-300x289.png 300w\" sizes=\"auto, (max-width: 496px) 100vw, 496px\" \/><\/a><\/p>\n<p>If the public key is already appended to the authorized_keys file on the remote SSH server, then proceed to Connect to Server with Private Key.<\/p>\n<p>Otherwise, proceed to Copy Public Key to Server.<br \/>\nCopy Public Key to Server<\/p>\n<p>The OpenSSH public key is located in the box under Key \/ Public key for pasting info OpenSSH authorized_keys file:. The public key begins with ssh-rsa followed by a string of characters.<\/p>\n<p>Highlight entire public key within the PuTTY Key Generator and copy the text.<br \/>\nLaunch PuTTY and log into the remote server with your existing user credentials.<\/p>\n<p>Use your preferred text editor to create and\/or open the authorized_keys file:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"># nano ~\/.ssh\/authorized_keys\n<\/pre>\n<p>Paste the public key into the authorized_keys file.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQBp2eUlwvehXTD3xc7jek3y41n9fO0A+TyLqfd5ZAvuqrwNcR2K7UXPVVkFmTZBes3PNnab4UkbFCki23tP6jLzJx\/MufHypXprSYF3x4RFh0ZoGtRkr\/J8DBKE8UiZIPUeud0bQOXztvP+pVXT+HfSnLdN62lXTxLUp9EBZhe3Eb\/5nwFaKNpFg1r5NLIpREU2H6fIepi9z28rbEjDj71Z+GOKDXqYWacpbzyIzcYVrsFq8uqOIEh7QAkR9H0k4lRhKNlIANyGADCMisGWwmIiPJUIRtWkrQjUOvQgrQjtPcofuxKaWaF5NqwKCc5FDVzsysaL5IM9\/gij8837QN7z rsa-key-20141103\n<\/pre>\n<p>Save the file and close the text editor.<br \/>\nAdjust the permissions of the authorized_keys file so that the file does not allow group writable permissions.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"># chmod 600 ~\/.ssh\/authorized_keys\n<\/pre>\n<p>Logout of the remote server.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Log into the Linux server as the user you are going to use to connect with ssh. Generate the key. ssh-keygen -t rsa -b 4096 -C &quot;email@domain.com&quot; Generating public\/private rsa key pair. Enter file in which to save the key (\/home\/user\/.ssh\/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been &#8230; <a title=\"Generate ssh keys on linux and use with PuTTY on Windows\" class=\"read-more\" href=\"https:\/\/www.qbytes.cloud\/index.php\/2018\/08\/10\/generate-ssh-keys-on-linux-and-use-with-putty-on-windows\/\" aria-label=\"Read more about Generate ssh keys on linux and use with PuTTY on Windows\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,110],"tags":[],"class_list":["post-4543","post","type-post","status-publish","format-standard","hentry","category-administration","category-ssh"],"_links":{"self":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/4543","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/comments?post=4543"}],"version-history":[{"count":0,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/4543\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/media?parent=4543"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/categories?post=4543"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/tags?post=4543"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}