Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
1.44/5 (3 votes)
See more:
How can I add Linux SSH keys of the remote server to my local Linux box. The SSH server IP address is 192.168.2.3

What I have tried:

How can I add Linux SSH keys of the remote server to my local Linux box. The SSH server IP address is 192.168.2.3
Posted
Updated 26-Mar-19 21:18pm
Comments
#realJSOP 18-Mar-19 15:41pm    
Don't use SSH.
k5054 18-Mar-19 15:51pm    
Why not?

1 solution

You should be able to use ssh-copy-id user@host That will copy your ssh-key from the current system to host. If you have more than one key in your .ssh folder, or added via ssh-add, you can select the key you wish to copy using the -i option. e.b. ssh-copy-id ~/.ssh/id_ecdsa user@host

If you don't have ssh-copy-id, you'll have to copy the key manually
localhost$ scp ~/.ssh/id_ecdsa.pub user@remote:
localhost$ ssh user@remote
user@remote‘s password:

remotehost$ cat id_ecdsa.pub >> .ssh/authorized_keys
remotehost$ chmod 600 .ssh/authorized_keys
remotehost$ exit
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900