{"id":227,"date":"2018-12-28T16:31:41","date_gmt":"2018-12-28T15:31:41","guid":{"rendered":"https:\/\/www.soft-toolware.net\/?p=227"},"modified":"2021-01-13T22:21:20","modified_gmt":"2021-01-13T21:21:20","slug":"ssh-public-key-authentication-using-puttygen","status":"publish","type":"post","link":"https:\/\/www.soft-toolware.net\/?p=227","title":{"rendered":"ssh Public Key Authentication using puTTYgen"},"content":{"rendered":"\n<h6 class=\"wp-block-heading\">The motivation for using public key authentication for ssh-Login over simple passwords is security. Public key authentication provides cryptographic strength that even extremely long passwords cannot.<\/h6>\n\n\n\n<h5 class=\"wp-block-heading\">What Is puTTYgen?<\/h5>\n\n\n\n<p>puTTYgen is a tool for creating new authentication key pairs for SSH. Such key pairs are used for automating logins, single sign-on, and for authenticating hosts.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Creating an SSH Key Pair for User Authentication<\/h5>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Run PUTTYGEN.EXE<\/strong> <ul><li>Make sure the key type is SSH-2 RSA (this is the most secure of the options)<\/li><li>Click <strong>Generate<\/strong><\/li><li>Move your mouse in the key field (the utility will use the math  associated with your mouse movements to generate a \u201crandom\u201d key). Keep  moving until the utility tells you to stop.<\/li><li>Enter a Key Passphrase and Confirm it in the utility<\/li><li>Save the private key locally.<\/li><li><\/li><\/ul><\/li><\/ul>\n\n\n\n<p>Here&#8217;s an example:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"281\" height=\"252\" src=\"https:\/\/www.soft-toolware.net\/wp-content\/uploads\/2017\/11\/PuttyGen01.jpg\" alt=\"\" class=\"wp-image-137\"\/><\/figure><\/div>\n\n\n\n<h5 class=\"wp-block-heading\">Copying the Public Key to the Server<\/h5>\n\n\n\n<p>To use public key authentication, the public key must be copied to a server and installed in an <em>authorized_keys<\/em> file. <br>Login as the user who wants to use the public key authentication and create a directory in the users home, call &#8220;.ssh&#8221;. <br>Open a file, named &#8220;authorized_keys&#8221; in this directory:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mkdir .ssh <br>Chmod 700 .ssh <br>nano ~\/.ssh\/authorized_keys<\/pre>\n\n\n\n<p>Paste the text from the public key generated with puTTYgen above into this file and save the file.<br>Changes the permissions on the file so group access is not allowed <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">chmod 600 ~\/.ssh\/authorized_keys <\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">How To Use Putty with an SSH Private Key Generated by OpenSSH<\/h5>\n\n\n\n<p>Now you can start Putty, enter the machine IP address as usual and &nbsp;then go to <em>Connection-&gt;SSH-&gt;Auth<\/em>.<br><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"355\" height=\"317\" src=\"https:\/\/www.soft-toolware.net\/wp-content\/uploads\/2017\/11\/PuttyGen02.jpg\" alt=\"\" class=\"wp-image-138\" srcset=\"https:\/\/www.soft-toolware.net\/wp-content\/uploads\/2017\/11\/PuttyGen02.jpg 355w, https:\/\/www.soft-toolware.net\/wp-content\/uploads\/2017\/11\/PuttyGen02-300x268.jpg 300w\" sizes=\"auto, (max-width: 355px) 85vw, 355px\" \/><\/figure><\/div>\n\n\n\n<p>Click <em>Browse<\/em>, and select your just created private key file (e.g. id_rsa_putty.ppk), go back to Session and save the session. <\/p>\n\n\n\n<p><br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The motivation for using public key authentication for ssh-Login over simple passwords is security. Public key authentication provides cryptographic strength that even extremely long passwords cannot. What Is puTTYgen? puTTYgen is a tool for creating new authentication key pairs for SSH. Such key pairs are used for automating logins, single sign-on, and for authenticating hosts. &hellip; <a href=\"https:\/\/www.soft-toolware.net\/?p=227\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;ssh Public Key Authentication using puTTYgen&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-227","post","type-post","status-publish","format-standard","hentry","category-tips-and-tricks"],"_links":{"self":[{"href":"https:\/\/www.soft-toolware.net\/index.php?rest_route=\/wp\/v2\/posts\/227","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.soft-toolware.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.soft-toolware.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.soft-toolware.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.soft-toolware.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=227"}],"version-history":[{"count":4,"href":"https:\/\/www.soft-toolware.net\/index.php?rest_route=\/wp\/v2\/posts\/227\/revisions"}],"predecessor-version":[{"id":265,"href":"https:\/\/www.soft-toolware.net\/index.php?rest_route=\/wp\/v2\/posts\/227\/revisions\/265"}],"wp:attachment":[{"href":"https:\/\/www.soft-toolware.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=227"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.soft-toolware.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=227"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.soft-toolware.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=227"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}