{"id":146,"date":"2015-04-15T11:18:46","date_gmt":"2015-04-15T11:18:46","guid":{"rendered":"https:\/\/www.nonamehosts.com\/blog\/?p=146"},"modified":"2015-04-15T11:18:46","modified_gmt":"2015-04-15T11:18:46","slug":"how-to-setup-ssh-login-without-password","status":"publish","type":"post","link":"https:\/\/www.nonamehosts.com\/blog\/tutorials\/how-to-setup-ssh-login-without-password\/","title":{"rendered":"How to setup SSH login without password"},"content":{"rendered":"<p>You can login to a Linux system without entering a password and here are 3 simple steps to set it up.<\/p>\n<p><!--more--><\/p>\n<p><strong>Step 1: Generate the authentication key<\/strong><\/p>\n<p>To generate private and public keys, run this on a local machine:<\/p>\n<pre class=\"lang:sh decode:true\">admin@local$ ssh-keygen\nGenerating public\/private rsa key pair.\nEnter file in which to save the key (\/home\/admin\/.ssh\/id_rsa):[Enter key]\nEnter passphrase (empty for no passphrase): [Press enter key]\nEnter same passphrase again: [Pess enter key]\nYour identification has been saved in \/home\/admin\/.ssh\/id_rsa.\nYour public key has been saved in \/home\/admin\/.ssh\/id_rsa.pub.\nThe key fingerprint is:\n33:b3:fe:af:95:95:18:11:31:d5:de:96:2f:f2:35:f9 admin@local<\/pre>\n<p><strong>\u00a0Step 2: Install the public key on server<\/strong><\/p>\n<p>SSH usually comes with an utility called <em>ssh-copy-id<\/em> that simply adds the contents of client\u2019s <em>~\/.ssh\/id_rsa.pub<\/em> to the server\u2019s <em>~\/.ssh\/authorized_keys<\/em>:<\/p>\n<pre class=\"lang:sh decode:true\">admin@local$ ssh-copy-id -i ~\/.ssh\/id_rsa.pub server\nadmin@server's password:\nNow try logging into the machine, with \"ssh 'server'\", and check in:\n\n.ssh\/authorized_keys\n\nto make sure we haven't added extra keys that you weren't expecting.<\/pre>\n<p>In case <em>ssh-copy-id<\/em>\u00a0isn&#8217;t available, you can use <em>scp<\/em> or other file transfer method.<\/p>\n<p><strong>Step 3: Access<\/strong><\/p>\n<p>Now just access the server by typing:<\/p>\n<pre class=\"lang:sh decode:true \">admin@local$ ssh server<\/pre>\n<p>You should see something like this:<\/p>\n<pre class=\"lang:sh decode:true \">admin@local$ ssh\u00a0server\nadmin@server$<\/pre>\n<p>Or this, if you entered the passphrase:<\/p>\n<pre class=\"lang:sh decode:true\">admin@local$ ssh\u00a0server\nEnter passphrase for key '\/home\/admin\/.ssh\/id_rsa':\nadmin@server$<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>You can login to a Linux system without entering a password and here are 3 simple steps to set it up.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[12,65,68,70,125],"class_list":["post-146","post","type-post","status-publish","format-standard","hentry","category-tutorials","tag-authentication","tag-keys","tag-linux","tag-login","tag-ssh"],"_links":{"self":[{"href":"https:\/\/www.nonamehosts.com\/blog\/wp-json\/wp\/v2\/posts\/146","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.nonamehosts.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nonamehosts.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nonamehosts.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nonamehosts.com\/blog\/wp-json\/wp\/v2\/comments?post=146"}],"version-history":[{"count":0,"href":"https:\/\/www.nonamehosts.com\/blog\/wp-json\/wp\/v2\/posts\/146\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.nonamehosts.com\/blog\/wp-json\/wp\/v2\/media?parent=146"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nonamehosts.com\/blog\/wp-json\/wp\/v2\/categories?post=146"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nonamehosts.com\/blog\/wp-json\/wp\/v2\/tags?post=146"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}