Skip to content

Instantly share code, notes, and snippets.

View LittleYe233's full-sized avatar
😮‍💨
Depressed

Zhifan Ye LittleYe233

😮‍💨
Depressed
View GitHub Profile
@LittleYe233
LittleYe233 / README.md
Last active March 27, 2022 04:01
Transfer GPG secret keys to another machine (Linux/Windows)

When you are setting up a coding environment on a new machine or has just found that your GPG keys were missing for some reasons (it really happened on my Windows PC), you may need to transfer your GPG secret keys elsewhere.

Method #1: Transfer directly

It takes advantage of gpg --export-secret-key, gpg --import and pipe syntax. This method is an excerpt of a StackOverflow answer.

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

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