Transfer your GPG public and private keys to another computer

(for k in $(gpg -K | egrep ^sec | awk '{print $2}' | awk -F/ '{print $2}'); do gpg --output - --export $k; gpg --output - --export-secret-key $k; done) | gpg --armor --output keys.asc --symmetric --cipher-algo AES256

Now, import the encrypted keys to your new machine

gpg --no-use-agent - keys.asc | gpg --import

About the Author
Freelance Linux DevOps Engineer, Loves to scale things and make stacks intelligent

Leave a Reply


captcha *