Change or set the passphrase of an SSH key
how to change ssh key passphrase | add passphrase to existing ssh key | remove ssh key passphrase | ssh-keygen | passphrase | ssh-keysCaution: This command changes the system. Understand what it does before you run it.
ssh-keygen -p -f ~/.ssh/id_ed25519_serverAsks for the old passphrase and twice for the new one, then saves the private key encrypted with the new passphrase. The public key stays the same, so nothing needs to be changed on the servers. An empty new passphrase removes the protection.
Note: If you have forgotten the old passphrase, there is no way around generating a new key pair.
Also searched as
- how to change ssh key passphrase
- add passphrase to existing ssh key
- remove ssh key passphrase