{"id":8,"date":"2013-01-31T10:41:51","date_gmt":"2013-01-31T10:41:51","guid":{"rendered":"http:\/\/nofl.biz\/blog\/?p=8"},"modified":"2013-01-31T10:41:51","modified_gmt":"2013-01-31T10:41:51","slug":"ssh-with-keys","status":"publish","type":"post","link":"https:\/\/beneford.com\/Blog\/index.php\/2013\/01\/31\/ssh-with-keys\/","title":{"rendered":"SSH with keys (no passwords)"},"content":{"rendered":"<p>Abstract: Instructions on setting up a Linux computer (server) so you can log in (from your client) with ssh without having to enter a password (using keys).<\/p>\n<p>Without a password, authentication is done with a key. To achieve password-less access, you need a key, and the computer you are logging in to needs to know about that key.<br \/>\nA Key has two parts &#8211; private and public. You keep the private part, you give the public part to anyone who needs to know you are who you say you are.<\/p>\n<p>Generate a key on the client computer using:<br \/>\n<code>ssh-keygen -t rsa<\/code><br \/>\nThis will create two files:<\/p>\n<table>\n<tbody>\n<tr>\n<td>File<\/td>\n<td>Description<\/td>\n<\/tr>\n<tr>\n<td>~\/.ssh\/id_rsa<\/td>\n<td>Your private key<\/td>\n<\/tr>\n<tr>\n<td>~\/.ssh\/id_rsa.pub<\/td>\n<td>Your public key<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>You need to add the contents of ~\/.ssh\/id_rsa.pub to the file ~\/.ssh\/authorized_keys on the server, logged in as the user you will be using:<br \/>\n<code>cat ~\/.ssh\/id_rsa.pub | ssh user@server \"mkdir -p ~\/.ssh &amp;&amp; cat &gt;&gt; ~\/.ssh\/authorized_keys\"<\/code><br \/>\nThis is the last time you will need to enter the password.<br \/>\nFrom now on, you can just connect using:<br \/>\n<code>ssh user@server<\/code><br \/>\nOr, if you are logged on to the client as the same username, just<br \/>\n<code>ssh-keygen -R ip-address<\/code><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Abstract: Instructions on setting up a Linux computer (server) so you can log in (from your client) with ssh without having to enter a password (using keys). Without a password, authentication is done with a key. To achieve password-less access, you need a key, and the computer you are logging in to needs to know [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-8","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/beneford.com\/Blog\/index.php\/wp-json\/wp\/v2\/posts\/8","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/beneford.com\/Blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/beneford.com\/Blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/beneford.com\/Blog\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/beneford.com\/Blog\/index.php\/wp-json\/wp\/v2\/comments?post=8"}],"version-history":[{"count":0,"href":"https:\/\/beneford.com\/Blog\/index.php\/wp-json\/wp\/v2\/posts\/8\/revisions"}],"wp:attachment":[{"href":"https:\/\/beneford.com\/Blog\/index.php\/wp-json\/wp\/v2\/media?parent=8"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/beneford.com\/Blog\/index.php\/wp-json\/wp\/v2\/categories?post=8"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/beneford.com\/Blog\/index.php\/wp-json\/wp\/v2\/tags?post=8"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}