{"id":168,"date":"2011-05-12T09:25:23","date_gmt":"2011-05-12T15:25:23","guid":{"rendered":"http:\/\/mattdturner.com\/wordpress\/?p=168"},"modified":"2011-05-12T14:37:09","modified_gmt":"2011-05-12T20:37:09","slug":"how-to-passwordless-ssh","status":"publish","type":"post","link":"http:\/\/mattdturner.com\/wordpress\/2011\/05\/how-to-passwordless-ssh\/","title":{"rendered":"How to:  Passwordless SSH"},"content":{"rendered":"<p><a href=\"http:\/\/mattdturner.com\/wordpress\/wp-content\/uploads\/2011\/05\/broken-lock.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright size-full wp-image-181\" title=\"broken-lock\" src=\"http:\/\/mattdturner.com\/wordpress\/wp-content\/uploads\/2011\/05\/broken-lock.jpg\" alt=\"\" width=\"280\" height=\"210\" \/><\/a>As some of you know, I prefer to set up passwordless logins to all of my accounts on remote machines.  I recently made a post describing <a href=\"http:\/\/mattdturner.com\/wordpress\/2011\/05\/enable-passwordless-ssh-to-compute-nodes-rocks-linux\/\">how to enable passwordless SSH to compute nodes<\/a>, however what if you are attempting to enable passwordless logins to remote machines?<\/p>\n<p>If you are on a Linux machine, or have a copy of the &#8220;ssh-copy-id&#8221; script on your system then the process is fairly simple. \u00a0You must first create the private\/public key pairing. \u00a0For passwordless SSH, just accept the defaults for each option.<\/p>\n<pre class=\"brush: plain; light: true; title: ; notranslate\" title=\"\">ssh-keygen -t rsa\r\nGenerating public\/private rsa key pair.\r\nEnter file in which to save the key (\/home\/cmaqadj\/.ssh\/id_rsa):\r\nEnter passphrase (empty for no passphrase):\r\nEnter same passphrase again:\r\nYour identification has been saved in \/home\/cmaqadj\/.ssh\/id_rsa.\r\nYour public key has been saved in \/home\/cmaqadj\/.ssh\/id_rsa.pub.\r\n<\/pre>\n<p><!--more-->Now you need to copy the contents of the .pub file into the authorized_keys file on the server.  To do this, just use the &#8220;ssh-copy-id&#8221; script<\/p>\n<pre class=\"brush: plain; light: true; title: ; notranslate\" title=\"\">ssh-copy-id -i ~\/.ssh\/id_rsa.pub username@remotehost<\/pre>\n<p>You will be prompted for a password.  After the script has run, you can now login to the server and you will not be prompted for a password.<\/p>\n<p>For those of you who used the &#8220;ssh-copy-id&#8221; script, you are now done; if you do not have &#8220;ssh-copy-id&#8221; on your computer, follow the below steps to enable passwordless ssh<\/p>\n<pre class=\"brush: plain; light: true; title: ; notranslate\" title=\"\">ssh-keygen -t rsa\r\nscp ~\/.ssh\/id_rsa.pub username@remotehost:~\/\r\nssh username@remotehost\r\ncat id_rsa.pub &gt;&gt; ~\/.ssh\/authorized_keys<\/pre>\n<p>And thats it. \u00a0To test that the keypairing has been correctly installed, exit from the remote host and attempt to login again. \u00a0If all went well, you will gain access to the remote server without being prompted for a password.<\/p>\n<div class=\"zemanta-pixie\" style=\"margin-top: 10px; height: 15px;\"><a class=\"zemanta-pixie-a\" title=\"Enhanced by Zemanta\" href=\"http:\/\/www.zemanta.com\/\"><img decoding=\"async\" class=\"zemanta-pixie-img\" style=\"border: none; float: right;\" src=\"http:\/\/img.zemanta.com\/zemified_e.png?x-id=8f9e5740-68fc-4e67-b4bf-e6498784d52b\" alt=\"Enhanced by Zemanta\" \/><\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>As some of you know, I prefer to set up passwordless logins to all of my accounts on remote machines. I recently made a post describing how to enable passwordless SSH to compute nodes, however what if you are attempting to enable passwordless logins to remote machines? If you are on a Linux machine, or [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[3,64,11],"tags":[30,50,69,104,143,141,144,142],"class_list":["post-168","post","type-post","status-publish","format-standard","hentry","category-command-line","category-linux-2","category-mac","tag-command-line-2","tag-linux","tag-mac-2","tag-password","tag-passwordless","tag-passwordless-ssh","tag-public-key-cryptography","tag-ssh","no-thumb"],"_links":{"self":[{"href":"http:\/\/mattdturner.com\/wordpress\/wp-json\/wp\/v2\/posts\/168"}],"collection":[{"href":"http:\/\/mattdturner.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/mattdturner.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/mattdturner.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/mattdturner.com\/wordpress\/wp-json\/wp\/v2\/comments?post=168"}],"version-history":[{"count":8,"href":"http:\/\/mattdturner.com\/wordpress\/wp-json\/wp\/v2\/posts\/168\/revisions"}],"predecessor-version":[{"id":192,"href":"http:\/\/mattdturner.com\/wordpress\/wp-json\/wp\/v2\/posts\/168\/revisions\/192"}],"wp:attachment":[{"href":"http:\/\/mattdturner.com\/wordpress\/wp-json\/wp\/v2\/media?parent=168"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/mattdturner.com\/wordpress\/wp-json\/wp\/v2\/categories?post=168"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/mattdturner.com\/wordpress\/wp-json\/wp\/v2\/tags?post=168"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}