To change the passphrase for a GPG secret key, you can use the gpg
command with the --edit-key
option followed by the key identifier. This will open the key in an interactive editor, where you can use the passwd
command to change the passphrase.
Here's an example of how to change the passphrase for a GPG secret key:
gpg --edit-key <key-identifier> gpg> passwd
Replace <key-identifier>
with the identifier for the secret key whose passphrase you want to change. This could be the email address associated with the key, the key's fingerprint, or the key's ID number.
When you run the passwd
command, GPG will prompt you to enter the current passphrase for the key, and then to enter a new passphrase. You will need to enter the new passphrase twice to confirm it.
Once you have entered the new passphrase, use the save
command to save your changes and exit the editor.
Keep in mind that changing the passphrase for a secret key will also change the passphrase for any subkeys associated with that key.
For more information about using the gpg
command to manage GPG keys, you can consult the GPG documentation or use the gpg --help
command to see a list of available options.