notebox

Transferring GPG Keys to a new machine

It is recommended that the transfer take place over ssh. Keys can be spoofed and cracked if done via USB devices, in case the device gets lost.

Transferring the whole Keyring, from the receiving machine:

scp -rp user@othermachine:/home/user/.gnupg ~/

if just one key needs to be transferred:

If you’re on the machine that already has the key:

gpg -export-secret-key SOMEKEYID | ssh othermachine gpg --import

If you’re on the machine that needs the key:

ssh othermachine gpg --export-secret-key SOMEKEYID | gpg --import

Reference:

Tags:

#literature-note #pgp #encryption #security