Última actividad 1780722861

How to backup a pass repo and share it in a way that you need three of five friends to decrypt it.

Revisión f909c0b9760fda2d0f614fdbe159814565519162

gistfile1.txt Sin formato
1# Pass Password Store — Backup Recovery Guide
2
3## How to Restore
4
5### Prerequisites
6
7```bash
8brew install age ssss pass
9```
10
11### 1. Reconstruct the passphrase
12
13Collect any 3 of the 5 shares, then:
14
15```bash
16ssss-combine -t 3 -q
17# paste 3 shares when prompted — outputs the passphrase
18```
19
20### 2. Decrypt the archive
21
22```bash
23age -d -o secrets.tar.gz secrets.tar.gz.age
24# paste the passphrase when prompted
25
26tar -xzf secrets.tar.gz
27```
28
29### 3. Import GPG keys
30
31```bash
32gpg --import new_pub.asc
33gpg --import new_secret.asc
34```
35
36Mark your own key as trusted:
37
38```bash
39gpg --edit-key EAB14D8405F7F6CFFE8B26BC5B91EB2A6CA3B89F
40# at the gpg> prompt:
41trust
42# select 5 (ultimate)
43quit
44```
45
46### 4. Restore the password store
47
48```bash
49git clone pass_backup_YYYYMMDD.bundle ~/.password-store
50```
51
52Another option is to just clone it to a tmp dir and decrypt indivual files manually as needed
53
54### 5. Verify
55
56```bash
57pass ls
58```
59
60
61## How the backup was created
62
631. Create secrets dir
641. Export GPG keys to secrets dir
651. Create Git Bundle and move it to secrets dir
661. Tar compress the secrets dir
671. Generate password
681. Use password to encrypt the sectets dir with age
691. split the password with ssss
70
71
72### 1. Create Git Bundle
73
74```bash
75mkdir /tmp/pass-backup
76cd ~/.password-store
77git bundle create /tmp/pass-backup/pass_backup_$(date +%Y%m%d).bundle --all
78```
79
80This exports the full repo with complete history. The resulting file can be cloned directly:
81
82```bash
83git clone pass_backup_YYYYMMDD.bundle restored-password-store
84```
85
86### 2. Export GPG Keys
87
88```bash
89gpg --export xxxxxxxxxxx > new_pub.asc
90gpg --export-secret-keys --armor xxxxxxxxxx > new_secret.asc
91```
92
93### 2. Encrypt the bundle with age
94
95```bash
96$ brew install age
97$ age -p pass_backup_20260605.bundle > pass_backup_20260605.bundle.age
98```
99
100
101### 3. Gen password
102
103```bash
104openssl rand -base64 96 > pw.txt
105```
106
107Then go in and delete the newline
108
109
110### 4. Split file with ssss
111
112```bash
113cat pw.txt | ssss-split -t 3 -n 5 -q > splits.txt
114```