33 lines
902 B
Markdown
33 lines
902 B
Markdown
---
|
|
date: 2020-06-20T13:43:46.000Z
|
|
title: moving gpg keys
|
|
draft: false
|
|
snippet_types:
|
|
- gpg
|
|
seo_description: How to move GPG keys from one computer to the next.
|
|
---
|
|
|
|
New laptop? Got to move over those GPG keys.
|
|
|
|
```shell
|
|
$ cd /tmp && mkdir gpg_export
|
|
$ gpg --output gpg_export/main_pub.gpg --armor --export t@travisshears.com
|
|
$ gpg --output gpg_export/main_sec.gpg --armor --export-secret-key t@travisshears.com
|
|
$ tar cvfz gpg_export.tar.gz ./gpg_export
|
|
$ gpg --symmetric ./gpg_export.tar.gz
|
|
```
|
|
|
|
Then move the encrypted tar to the new computer, with airdrop for example.
|
|
|
|
To import the keys.
|
|
|
|
```shell
|
|
$ gpg --decrypt gpg_export.tar.gz.gpg > gpg_export.tar.gz
|
|
$ tar xvfz gpg_export.tar
|
|
$ gpg --import gpg_export/main_sec.gpg
|
|
$ gpg --import gpg_export/main_pub.gpg
|
|
```
|
|
|
|
Source:
|
|
|
|
* [https://www.debuntu.org/how-to-importexport-gpg-key-pair/](https://www.debuntu.org/how-to-importexport-gpg-key-pair/)
|