Monday, December 14, 2020

How to remove or change the passphrase from a private key

If you have a passphrase protected private key you may get bored of typing the passphrase each time or perhaps you wish to change the passphrase. In any case you can use ssh-keygen for both of these operations. You still must know the old passphrase however.

$ ssh-keygen -p -f privatekey_rsa
Enter old passphrase:
Enter new passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved with the new passphrase.

Take note that this will overwrite your existing key, so you may wish to create a backup of it before running this operation.

No comments:

Post a Comment