Migrate gpg keys to new machine.
- November 29th, 2018
- Posted in Documentation
- Write comment
CentOS 7:
As the user on the machine where the keys are that you want to migrate:
Export the public keys:
gpg -a –export >mypublickey.asc
Export the private keys:
gpg -a –export-secret-keys > myprivatekey.asc
Export you trust database:
gpg –export-ownertrust > mytrust.db
Copy the mypublickeys.asc, myprivatekeys.asc and mytrust.db to the new machine.
Log into the new machine as the user you want the keys for:
Import the private key file:
gpg –import myprivatekey.asc
Import the public key file:
gpg –import mypublickey.asc
List the secret keys to verify:
gpg -K
List the public keys to verify:
gpg -k
Import the trustdb:
gpg –import-ownertrust mytrust.db
No comments yet.