Home > Mobile >  How to add a passphrase for ssh key after its been created?
How to add a passphrase for ssh key after its been created?

Time:07-28

Is generating a new one necessary, or is there a way to go back and add a passphrase? I have generated an ssh key, but would like to go back and add a passphrase. I haven't linked it to my github yet. Is there any way to do this?

CodePudding user response:

As explained here, you can add a passphrase to an existing private key with:

cd ~/.ssh
ssh-keygen -o -p -f keyfile

But you can also link that to GitHub immediately: adding a passphrase (encrypting the private key) does not change the public key you would register to your GitHub profile.
The public key will remain the same, before and after you add a passphrase to your local private key.

  • Related