Programster's Blog

Tutorials focusing on Linux, programming, and open-source

SSH Key Cheatsheet

SSH

As with all cheatsheets, this will be added to over time.

For the cheats below, you may replace [key path] with ~/.ssh/id_rsa if you are concerned with just your own computers key rather than a key file.

Create Key

ssh-keygen

Add Passphrase

If you were given an unencrypted SSH key, such as from AWS, then you probably want to add a passphrase to it with the following command:

ssh-keygen -p -f my-private-key.pem

Remove Passphrase

openssl rsa -in [key path] -out [key path].new

Generate public key from private key

ssh-keygen -f [key path] -y > [key path].pub

Add Key To Remote Server

Refer here if you wish to see how to easily add this key to a remote server so that you can use it to log in.

References