How to add your SSH public key to a Linux server

Michael Roma

Assuming you have your SSH public key here: ~/.ssh/id_rsa.pub, run the following command:

cat ~/.ssh/id_rsa.pub | ssh username@your-server.domain.com ‘cat >> ~/.ssh/authorized_keys’