Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Command to send public key to remote host

I remember there is a command to send public key to the remote host that I want. I want to use that feature to send one of my public keys to the other host. How can I do that?

like image 650
user482594 Avatar asked Aug 09 '11 02:08

user482594


People also ask

Can I send my public SSH key?

Conceivably, you can share the public key with anyone without compromising the private key; you store it on the remote system in a . ssh/authorized_keys directory. To use SSH public key authentication: The remote system must have a version of SSH installed.


1 Answers

You are looking for ssh-copy-id. All this command does is create .ssh and .ssh/authorized_keys and set their permissions appropriately if they don't exist. Then it appends your public key to the end of .ssh/authorized_keys.

like image 154
cdhowie Avatar answered Sep 19 '22 14:09

cdhowie