Skip to main content

Linux command: ssh-copy-id


ssh-copy-id copy ssh public key to remote host

ssh-copy-id - install your identity.pub public key in a remote machine’s authorized_keys

Syntax

ssh-copy-id [-i [identity_file]] [user@]machine

Copy ssh public key to host 192.168.64.115

[tuyen@rhel5 ~]$ ssh-copy-id -i ~/.ssh/tuyenid_rsa.pub tuyen@192.168.64.115
32
The authenticity of host '192.168.64.115 (192.168.64.115)' can't be established.
RSA key fingerprint is 34:75:a1:bc:f4:15:d6:19:e6:0b:3b:cf:04:74:d0:c3.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.64.115' (RSA) to the list of known hosts.
tuyen@192.168.64.115's password:
Now try logging into the machine, with "ssh 'tuyen@192.168.64.115'", and check in:

  .ssh/authorized_keys

to make sure we haven't added extra keys that you weren't expecting.

[tuyen@rhel5 ~]$

ssh to 192.168.64.115 using ssh private key

[tuyen@rhel5 ~]$ ssh -i .ssh/tuyenid_rsa tuyen@192.168.64.115
Last login: Tue Jun 18 11:29:06 2019 from 192.168.64.102
[tuyen@ol7 ~]$

Copy SSH public key from Microsoft Windows to Linux

PS C:\Users\tuyen> type .\.ssh\tuyenid_rsa.pub | ssh tuyen@192.168.64.115 "cat >> .ssh/authorized_keys"

Popular posts from this blog

IIS: Delete cached files on server running IIS

Delete cached files on server running IIS When changing css, javascript files, check to delete if IIS still caches old files in the default folder C:\inetpub\temp\IIS Temporary Compressed Files\<sitename>\$^_gzip_D^\ Apply to: IIS 8.5

Linux command: du - disk usage

Where have all my storage gone? du summarize disk usage of the set of FILEs, recursively for directories.

ManageEngine ServiceDesk Plus - Reset password

Let's reset the default administrator's password to 'admin'