Skip to content

Instantly share code, notes, and snippets.

@akloya
Created April 3, 2018 22:02
Show Gist options
  • Save akloya/0aad344f2f0eacbb8396174dac634745 to your computer and use it in GitHub Desktop.
Save akloya/0aad344f2f0eacbb8396174dac634745 to your computer and use it in GitHub Desktop.
GPG transfer private keys
GPG: transfer/import private keys to different machine
Some time you might need to copy your keys to another machine
Identify your private key by running
> gpg --list-secret-keys.
Run this command to export your key:
> gpg --export-secret-keys $ID > my-private-key.asc
Copy the key to the other machine using scp
To import the key, run
> gpg --import my-private-key.asc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment