I already have a ssh private key without a passphrase. As I have started to use it to login to a few critical and secure systems, I need to use a passphrase on my RSA private key. How can I enable passphrase on an already existing private key? Also I want to know how to backup the private key before I enable passphrase, in case I mess up or forget the passphrase (only for some days until I can commit the passphrase to my memory).


1 Answer 1


You could use the -p option to ssh-keygen:

ssh-keygen -p -f /path-to/key-file

It will prompt for old and new passphrase. It will also prompt for keyfile (with suggestion) if you do not provide -f key-file option.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.