add the old snippet md files

This commit is contained in:
Travis Shears 2025-06-05 16:20:57 +02:00
parent fc0dd204c7
commit bcf8313a4b
110 changed files with 3048 additions and 0 deletions

View file

@ -0,0 +1,24 @@
---
title: "gpg usb workflow"
date: 2021-06-13T08:49:38+02:00
draft: false
snippet_types:
- gpg
---
How to use a GPG key stored on a flash drive to encrypt files? I was perplexed for sometime. Eventually I figured out instead of exporting, importing, file system linking.. you just use a remote key ring that contains the keys you want!
1. Create the new key on the flash drive with
```shell
$ gpg --full-generate-key --homedir /Volumes/usb_flash_stick/key_homedir
```
2. Use that new public key to encrypt files
```shell
$ gpg --encrypt-files --homedir /Volumes/usb_flash_stick/key_homedir -r XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ./file_a
```
This also bring the possibility of only storing the public key locally and having the secret key safe on the USB. See
[how to move keys snippet](/snippets/moving-gpg-keys).