0

I recently move from debian to Arch. Before wiping my disk, I did a backup of my ~/.gnupg folder.

I've restored it, but now gpg --list-secret-keys doesn't show anything even if my keys are here:

$ ls -l ~/.gnupg/private-keys-v1.d/
total 16
-rw------- 1 me me 423 19 aug  02:34 1BExxx.key
-rw------- 1 me me 423 19 aug  02:34 310xxx.key
-rw------- 1 me me 423 19 aug  02:34 829xxx.key
-rw------- 1 me me 430 19 aug  02:34 D98xxx.key

Have I just lost my gpgkeys ? Or am I missing something here ?

Thanks

3
  • What are the perms on the ~/.gnupg and ~/.gnupg/private-keys-v1.d/ directories? They need to be 700 (drwx------). BTW, you can recursively check the perms, owner, and group on everything under ~/.gnupg in one command with find ~/.gnupg/ -exec stat -c '%a %A %U %G %n' {} +. Files should be 600 (-rw-------), directories 700. owned by your user and your group. Or just find ~/.gnupg/ -ls if you don't need to see the octal permissions. This is assuming GNU find and GNU stat, other versions are different. Commented Aug 19 at 9:38
  • Thanks for your answer ! All folders are indeed 700 and all files 600. And I've also double check the owner with a chown -R $(whoami):$(whoami) ~/.gnupg. Commented Aug 19 at 10:34
  • Did you also (backup and) restore pubring.kbx? (recent) gpg needs BOTH the gcrypt-level key in private-keys-v1.d/ AND the PGP-level data in pubring. Basically dupe unix.stackexchange.com/questions/772267/… . The safe way to move this data is (was) to --export-secret-keys on the old and --import on the new Commented Aug 20 at 1:25

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.