To change the passphrase of a GPG secret key, you can use the gpg --edit-key
command followed by the key ID and then the passwd
subcommand. The process will prompt you to enter the current passphrase and then to enter the new passphrase twice for confirmation. Here’s an example:
gpg --edit-key [KEY_ID]
gpg> passwd
Enter the current passphrase.
Enter the new passphrase.
Repeat the new passphrase.
gpg> save
In the above example, replace [KEY_ID]
with the identifier of the secret key you want to change the passphrase for.