Install GPG keys on a server

When you SSH into a server, a common problem is that you a) don’t want to add your password over and over again or b) the server only allows public key authorization.

Assuming that you are already using GPG encryption, you only need to tell the server about your public key.

On your local computer execute

cat ~/.ssh/

copy the output on your clipboard…

Then after logging into the server, perform

vim ~/.ssh/authorized_keys

and paste at the end of the file and save.



Sometimes you also get lucky and only need to call

ssh-copy-id $servername

…and enter your password. It will do this automatically.

Like what you read? Give Laura Dietz a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.