SSH Key Cheatsheet

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.

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

Generate public key from private key

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

Add/Change password protection

ssh-keygen -p -f [key path]

Remove password protection

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

References

Author

Programster

Stuart is a software developer with a passion for Linux and open source projects.

comments powered by Disqus
We are a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for us to earn fees by linking to Amazon.com and affiliated sites. More info.