Last Updated: September 09, 2019
·
2.243K
· rrader

Remove passphrase from private key

If you want to avoid creating new key just to remove annoying passphrase prompt after every operation, just do

$ openssl rsa -in ~/.ssh/id_rsa -out ~/.ssh/id_rsa.new

openssl will ask you passphrase, parse decoded idrsa and write out result to idrsa.new

Next, just replace idrsa with idrsa.new

$ mov ~/.ssh/id_rsa ~/.ssh/id_rsa.old
$ mov ~/.ssh/id_rsa.new ~/.ssh/id_rsa

3 Responses
Add your response

I wouldn't recommend doing this. Instead use ssh-agent, it will store your password (or rather the decrypted key) in memory and you you'll only need to enter it on new sessions.

over 1 year ago ·

@Smotko In most cases it's good to use agent, but when you accessing your private git repository, I think it's unnecessary.

over 1 year ago ·

Advocating poor security is a terrible practice.

over 1 year ago ·