{"id":321,"date":"2019-07-23T21:15:00","date_gmt":"2019-07-23T21:15:00","guid":{"rendered":"http:\/\/mohammedlakkadshaw.com\/blog\/?p=321"},"modified":"2019-07-23T21:15:00","modified_gmt":"2019-07-23T21:15:00","slug":"ssh-copy-id-the-easiest-way-to-copy-ssh-keys-to-another-machine","status":"publish","type":"post","link":"https:\/\/mohammedlakkadshaw.com\/blog\/ssh-copy-id-the-easiest-way-to-copy-ssh-keys-to-another-machine.html","title":{"rendered":"ssh-copy-id: The easiest way to copy ssh keys to another machine"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">I wanted to copy ssh keys to the server so that I could log in without requiring to enter the password. To do that typically I would ssh into the server and copy the public key of my laptop the authorized_keys on the remote server.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I came across a better way and I realized I have been doing it wrong for a very long time and there is a much simpler way to do it, using the ssh-copy-id command.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Just run the following command in the terminal<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ssh-copy-id username@remote_server_ip<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">e.g<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ssh-copy-id ubuntu@108.12.10.198<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">It will prompt you to enter the password, and then after that, it will copy the public key on your computer to the authorized_keys on the remote computer, and now you will be able to SSH without entering the password.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That&#8217;s it! Let me know if you have any questions or comments.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I wanted to copy ssh keys to the server so that I could log in without requiring to enter the password. To do that typically I would ssh into the server and copy the public key of my laptop the authorized_keys on the remote server. I came across a better way and I realized I [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-321","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/mohammedlakkadshaw.com\/blog\/wp-json\/wp\/v2\/posts\/321","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mohammedlakkadshaw.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohammedlakkadshaw.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohammedlakkadshaw.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohammedlakkadshaw.com\/blog\/wp-json\/wp\/v2\/comments?post=321"}],"version-history":[{"count":0,"href":"https:\/\/mohammedlakkadshaw.com\/blog\/wp-json\/wp\/v2\/posts\/321\/revisions"}],"wp:attachment":[{"href":"https:\/\/mohammedlakkadshaw.com\/blog\/wp-json\/wp\/v2\/media?parent=321"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohammedlakkadshaw.com\/blog\/wp-json\/wp\/v2\/categories?post=321"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohammedlakkadshaw.com\/blog\/wp-json\/wp\/v2\/tags?post=321"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}