Copy Your SSH Public Key to a Remote Server

Copy Your SSH Public Key to a Remote Server

A quick guide to copying your SSH public key to a remote server using ssh-copy-id or scp.

ssh-keygen -t rsa

copy ssh public key is very simple. there are some ways to achieve this:

ssh-copy-id user@host

with this very simple command you can copy your public key to any user@host combination

Using scp

scp .ssh/id_rsa.pub user@host2:.ssh/authorized_keys

cd ~/ before.

The different is that scp will create a new file called authorized_keys while ssh-copy-id will add to id.