{"id":32,"date":"2017-04-15T19:37:52","date_gmt":"2017-04-15T19:37:52","guid":{"rendered":"http:\/\/jrm4.com\/blog\/?p=32"},"modified":"2017-04-15T19:37:52","modified_gmt":"2017-04-15T19:37:52","slug":"ssh-without-passwords-an-intuitive-explanation","status":"publish","type":"post","link":"https:\/\/jrm4.com\/blog\/ssh-without-passwords-an-intuitive-explanation\/","title":{"rendered":"SSH without passwords, an intuitive explanation"},"content":{"rendered":"<p>..because I&#8217;ve never seen one.<\/p>\n<p>LOTS of things in computing are badly named. I&#8217;m going to fix that. Public\/private keys are certainly one of them. Let&#8217;s focus on when using them to log in to remote servers with SSH without a password.<\/p>\n<p>Here&#8217;s a good way to think about it: Forget the idea that you&#8217;re creating two keys. You&#8217;re creating a lock and a key for that lock.<\/p>\n<p>The &#8220;public key&#8221; is NOT a key at all. It&#8217;s a *lock*. Think either a padlock or combination lock.<br \/>\nThe private key IS actually a key, it&#8217;s the key or combination for that lock.<\/p>\n<p>Let&#8217;s say you&#8217;re trying to connect to a server called &#8220;remote&#8221; from a computer at &#8220;home.&#8221; Thus, &#8220;home&#8221; needs a key, and &#8220;remote&#8221; needs a lock. Here&#8217;s what needs to be done.<\/p>\n<p>1) create the key and the lock at &#8220;home&#8221; (which you do at the same time.)<\/p>\n<pre>ssh-keygen -t rsa<\/pre>\n<p>(all the defaults are fine)<\/p>\n<p>2) Next, put your new lock on &#8220;remote.&#8221;<\/p>\n<pre>ssh-copy-id user@remote<\/pre>\n<p>Done. That&#8217;s the *necessary* stuff. Now, because you are disabling passwords, here are some things you&#8217;re going to want to think about that I&#8217;m not going to cover here:<\/p>\n<p>&#8211; You&#8217;ve made a key that can open a server, so now whoever has that key can do so. Keep it safe. Think about permissions and who has access to &#8220;home.&#8221;<\/p>\n<p>&#8211; If you have multiple clients and multiple servers? The analogy sort of fails a bit here, multiple locks on one server means EACH individual key can open it, you don&#8217;t need all of them. That being said, you still probably want to do it this way, i.e. make one key(pair) for each home\/client, not for each server.<\/p>\n","protected":false},"excerpt":{"rendered":"<a href=\"https:\/\/jrm4.com\/blog\/ssh-without-passwords-an-intuitive-explanation\/\" rel=\"bookmark\" title=\"Permalink to SSH without passwords, an intuitive explanation\"><p>..because I&#8217;ve never seen one. LOTS of things in computing are badly named. I&#8217;m going to fix that. Public\/private keys are certainly one of them. Let&#8217;s focus on when using them to log in to remote servers with SSH without a password. Here&#8217;s a good way to think about it: Forget the idea that you&#8217;re [&hellip;]<\/p>\n<\/a>","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/jrm4.com\/blog\/wp-json\/wp\/v2\/posts\/32"}],"collection":[{"href":"https:\/\/jrm4.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jrm4.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jrm4.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jrm4.com\/blog\/wp-json\/wp\/v2\/comments?post=32"}],"version-history":[{"count":3,"href":"https:\/\/jrm4.com\/blog\/wp-json\/wp\/v2\/posts\/32\/revisions"}],"predecessor-version":[{"id":44,"href":"https:\/\/jrm4.com\/blog\/wp-json\/wp\/v2\/posts\/32\/revisions\/44"}],"wp:attachment":[{"href":"https:\/\/jrm4.com\/blog\/wp-json\/wp\/v2\/media?parent=32"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jrm4.com\/blog\/wp-json\/wp\/v2\/categories?post=32"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jrm4.com\/blog\/wp-json\/wp\/v2\/tags?post=32"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}