ssh-copy-id

Tom H tomh0665 at gmail.com
Thu Dec 29 13:43:26 UTC 2016


On Wed, Dec 28, 2016 at 3:45 AM, Tom H <tomh0665 at gmail.com> wrote:
> On Wed, Dec 28, 2016 at 1:38 AM, thufir <hawat.thufir at gmail.com> wrote:
>>
>> The key you need to transfer to the host is the public one. If you can
>> log in to a computer over SSH using a password, you can transfer your RSA
>> key by doing the following from your own computer:
>>
>> ssh-copy-id <username>@<host>
>>
>> https://help.ubuntu.com/community/SSH/OpenSSH/Keys
>>
>> the "host" refers to the remote? local would be, for example, a laptop.
>
> Yes. You're copying the public key to the host into which you want to
> ssh using a key.
>
>
>> I thought I read to copy the private key...?
>
> Definitely not.

FYI, if you have a system that doesn't have ssh-copy-id, you can use

cat ~/.ssh/id_rsa.pub | ssh username at remote_hostname "mkdir -p ~/.ssh
&& cat >> ~/.ssh/authorized_keys"

to copy your public key.




More information about the ubuntu-users mailing list