{"id":168,"date":"2010-02-24T23:27:57","date_gmt":"2010-02-25T07:27:57","guid":{"rendered":"http:\/\/blog.portnumber53.com\/?p=168"},"modified":"2010-02-24T23:27:57","modified_gmt":"2010-02-25T07:27:57","slug":"making-your-server-trust-your-laptop","status":"publish","type":"post","link":"https:\/\/blog.portnumber53.com\/index.php\/2010\/02\/24\/making-your-server-trust-your-laptop\/","title":{"rendered":"Making your server trust your laptop"},"content":{"rendered":"<p>To avoid copying and pasting my password (mostly in the wrong window), I thought it would be better to make my server trust my laptop by using public\/private keys:<br \/>\nHere we go:<\/p>\n<p>For Linux (or BSD, or OSX):<\/p>\n<p>1. Open a terminal on your laptop and generate your keys:<\/p>\n<pre class=\"brush:bash\">ssh-keygen -t rsa<\/pre>\n<p>You may optionally choose a passphrase (which I didn&#8217;t since the I want to avoid typing).<\/p>\n<p>2. Copy the public key to your server:<\/p>\n<pre class=\"brush:bash\">scp ~\/.ssh\/id_rsa.pub username@server_address:\/your\/home\/folder\/<\/pre>\n<p>3. SSH into your server and add your public key to the authorized_keys file:<\/p>\n<pre class=\"brush:bash\">cd ~\/.ssh\necho \"#Something to identify your key\" >> authorized_keys\ncat \/your\/home\/folder\/id_rsa.pub >> authorized_keys<\/pre>\n<p>4. Open another terminal and try logging to your server just providing your username:<\/p>\n<pre class=\"brush:bash\">ssh username@server_address<\/pre>\n<p>You should be granted with the shell command line from your server. If not, please review what you did. If still doesn&#8217;t work, drop me a line:<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to use private\/public keys to have your server trust your laptop, so you don&#8217;t need to type your password over the wire <a class=\"continue-reading-link\" href=\"https:\/\/blog.portnumber53.com\/index.php\/2010\/02\/24\/making-your-server-trust-your-laptop\/\"> Continue reading <span class=\"meta-nav\">&rarr; <\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[66,205,219,263,265,269,278,283,320],"class_list":["post-168","post","type-post","status-publish","format-standard","hentry","category-hosting","tag-bsd","tag-keys","tag-linux","tag-openssh","tag-osx","tag-password","tag-private","tag-public","tag-ssh"],"_links":{"self":[{"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/posts\/168","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/comments?post=168"}],"version-history":[{"count":0,"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/posts\/168\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/media?parent=168"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/categories?post=168"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/tags?post=168"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}