Skip to content

Instantly share code, notes, and snippets.

@pid
Last active December 18, 2015 10:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pid/5766376 to your computer and use it in GitHub Desktop.
Save pid/5766376 to your computer and use it in GitHub Desktop.
SSH Security
# Improving the security of your SSH private key files (
# Better key protection with PKCS#8
# http://martin.kleppmann.com/2013/05/24/improving-security-of-ssh-private-keys.html
mv ~/.ssh/id_rsa ~/.ssh/id_rsa.old
openssl pkcs8 -topk8 -v2 des3 -in ~/.ssh/id_rsa.old -out ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
# Check that the converted key works; if yes, delete the old one:
rm ~/.ssh/id_rsa.old
# Changing a Passphrase with ssh-keygen
cd .ssh
# To change RSA passphrase, enter:
#ssh-keygen -f id_rsa -p
# To change DSA passphrase, enter:
#ssh-keygen -f id_dsa -p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment