{"id":4773,"date":"2010-11-18T10:00:29","date_gmt":"2010-11-18T02:00:29","guid":{"rendered":"http:\/\/nick.onetwenty.org\/?p=4773"},"modified":"2010-12-30T07:01:00","modified_gmt":"2010-12-29T23:01:00","slug":"simple-ssh-authentication-with-keys","status":"publish","type":"post","link":"https:\/\/nick.onetwenty.org\/index.php\/2010\/11\/18\/simple-ssh-authentication-with-keys\/","title":{"rendered":"Simple SSH authentication with keys"},"content":{"rendered":"<p>This is for anyone who uses passwords (exclusively) to login to remote machines.<\/p>\n<p>With ever-increasing computing power available to those that want to access your accounts, chances are that your passwords aren&#8217;t strong (ie. long and random) enough to represent decent security. You should be using SSH authentication keys. Thankfully, it&#8217;s quick and easy to do so!<\/p>\n<p>In a terminal on your (client) machine, generate an private\/public key file pair.<\/p>\n<p>If you don&#8217;t yet have a key file (usually because you haven&#8217;t run ssh-keygen before), run:<\/p>\n<blockquote>\n<pre>ssh-keygen<\/pre>\n<\/blockquote>\n<p>Otherwise, run:<\/p>\n<blockquote>\n<pre>ssh-keygen -p<\/pre>\n<\/blockquote>\n<p>Now install your public key on remote servers:<\/p>\n<blockquote>\n<pre>ssh-copy-id -i ~\/.ssh\/id_rsa.pub user@server<\/pre>\n<\/blockquote>\n<p>Congratulations! You can now login to remote servers more securely, and without the need for a password! (Although you can choose to encrypt the key using a password &#8211; for that extra little bit of security.)<\/p>\n<p>Thanks (and keep being awesome) <a href=\"http:\/\/www.debian-administration.org\/articles\/530\">debian administrator website<\/a>.<\/p>\n<p><em><strong>Update<\/strong>: As Jack points out, there isn&#8217;t any security benefit if the server still allows password authentication. So either disable it, or set the password to something very long and very random.<\/em><\/p>\n<p><em><strong>Update<\/strong>: Added a note about what to do if you don&#8217;t already have a key file.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is for anyone who uses passwords (exclusively) to login to remote machines. With ever-increasing computing power available to those that want to access your accounts, chances are that your passwords aren&#8217;t strong (ie. long and random) enough to represent decent security. You should be using SSH authentication keys. Thankfully, it&#8217;s quick and easy to &hellip; <a href=\"https:\/\/nick.onetwenty.org\/index.php\/2010\/11\/18\/simple-ssh-authentication-with-keys\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Simple SSH authentication with keys&#8221;<\/span><\/a><\/p>\n","protected":false},"author":67,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false},"categories":[1],"tags":[],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/paLsRH-1eZ","_links":{"self":[{"href":"https:\/\/nick.onetwenty.org\/index.php\/wp-json\/wp\/v2\/posts\/4773"}],"collection":[{"href":"https:\/\/nick.onetwenty.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nick.onetwenty.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nick.onetwenty.org\/index.php\/wp-json\/wp\/v2\/users\/67"}],"replies":[{"embeddable":true,"href":"https:\/\/nick.onetwenty.org\/index.php\/wp-json\/wp\/v2\/comments?post=4773"}],"version-history":[{"count":16,"href":"https:\/\/nick.onetwenty.org\/index.php\/wp-json\/wp\/v2\/posts\/4773\/revisions"}],"predecessor-version":[{"id":4787,"href":"https:\/\/nick.onetwenty.org\/index.php\/wp-json\/wp\/v2\/posts\/4773\/revisions\/4787"}],"wp:attachment":[{"href":"https:\/\/nick.onetwenty.org\/index.php\/wp-json\/wp\/v2\/media?parent=4773"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nick.onetwenty.org\/index.php\/wp-json\/wp\/v2\/categories?post=4773"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nick.onetwenty.org\/index.php\/wp-json\/wp\/v2\/tags?post=4773"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}