How do I remove the passphrase for the SSH key without having to create a new key?
I set a passphrase when creating a new SSH key on my laptop. But, as I realise now, this is quite painful when you are trying to commit (Git and SVN) to a remote location over SSH many times in an hour.
This will then prompt you to enter the keyfile location, the old passphrase, and the new passphrase (`which can be left blank to have no passphrase`).
If you would like to do it all on one line without prompts do:
You might want to consider using
#id_rsa #ssh #passphrase #keygen #linux #osx #remove_passphrase
I set a passphrase when creating a new SSH key on my laptop. But, as I realise now, this is quite painful when you are trying to commit (Git and SVN) to a remote location over SSH many times in an hour.
$ ssh-keygen -p
Enter file in which the key is (/Users/my_username/.ssh/id_rsa):
Enter old passphrase:
Enter new passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved with the new passphrase.
This will then prompt you to enter the keyfile location, the old passphrase, and the new passphrase (`which can be left blank to have no passphrase`).
If you would like to do it all on one line without prompts do:
$ ssh-keygen -p [-P old_passphrase] [-N new_passphrase] [-f keyfile]
NOTE:
Beware that when executing commands they will typically be logged in your ~/.bash_history
file (or similar) in plain text including all arguments provided (i.e. the passphrases in this case). It is therefore is recommended that you use the first option unless you have a specific reason to do otherwise.You might want to consider using
ssh-agent
, which can cache the passphrase for a time. The latest versions of gpg-agent
also support the protocol that is used by ssh-agent
.#id_rsa #ssh #passphrase #keygen #linux #osx #remove_passphrase