From 232a3f23bdccef7ca3aa189276dcf468c6966dbb Mon Sep 17 00:00:00 2001 From: Dmitriy Pleshevskiy Date: Fri, 17 Mar 2023 12:21:12 +0300 Subject: [PATCH] notes: add info about gpg --- notes/gpg.md | 33 +++++++++++++++++++++++++++++++++ notes/ssh.md | 2 +- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 notes/gpg.md diff --git a/notes/gpg.md b/notes/gpg.md new file mode 100644 index 0000000..af2f626 --- /dev/null +++ b/notes/gpg.md @@ -0,0 +1,33 @@ +# Generate key + +```sh +gpg --full-generate-key +``` + +# GnuPG Backup + +References: + +- https://www.howtogeek.com/816878/how-to-back-up-and-restore-gpg-keys-on-linux/ + +## Export keys + +```sh +gpg --export --export-options backup --output public.gpg +gpg --export-secret-keys --export-options backup --output private.gpg +gpg --export-ownertrust > trust.gpg +``` + +## Import keys + +```sh +gpg --import public.gpg +gpg --import private.gpg +gpg --import-ownertrust trust.gpg +``` + +## Verify + +```sh +gpg --list-secret-keys --keyid-format long +``` diff --git a/notes/ssh.md b/notes/ssh.md index bffc687..7474dd7 100644 --- a/notes/ssh.md +++ b/notes/ssh.md @@ -12,6 +12,6 @@ ssh-keyscan localhost # Generate new ssh key -``` +```sh ssh-keygen -t ed25519 -C "bob@example.com" ```