I set the passphrase of my ssh key by mistake.
But it is annoying that putting the passphrase for every time using the key.
I'd like to remove the passphrase of my key with:
$ ssh-keygen -p -f <my/key/file>
I'm afraid of that, however, the key would be changed.
The job is seemed too danger to test since I use the key in several way.
The man page says, the command would not change the key I think, but it is uncertain:
-p
Requests changing the passphrase of a private key file instead of creating a new private key. The program will prompt for the file containing the private key, for the old passphrase, and twice for the new passphrase.
Indeed, the passphrase is just a local protection for a private key file. From server-perspective, the key stays the same.
There's no danger for you in trying. Just backup your encrypted key before conversion.
Though the right solution is to use an authentication agent (like OpenSSH ssh-agent
). With the agent, you type the passphrase only once, when loading the key into the agent.
If you want/need an unencrypted key for some automation, the right solution is to have two keys. One encrypted for interactive use and one unencrypted for unattended use. So that in case your unencrypted key is compromised, you can cancel it without a need to replace your encrypted one.
Another solution would be reset your password to a new one using ssh-agent and leave new password as an empty string
.ssh
folder via Terminalssh-keygen -p
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With