You are not logged in.

#1 2022-01-26 02:37:27

Donzv
Member
Registered: 2021-03-24
Posts: 7

How does Archlinux initialize ~/.gnupg?

The wiki page says that $HOME/.gnupg can be initialized for new users with

# addgnupghome user

However, when I try it, it says:

addgnupghome: skeleton directory `/etc/skel/.gnupg' does not exist

Before I deleted my ~/.gnupg (with the intention of resetting GPG completely), I had a gpg.conf file in there, and after deleting ~/.gnupg and running gpg --full-generate-key that file was not recreated. This causes various software like KGpg to whine that the file is missing. However that file was there before, from which I deduce that the archlinux installer (which created my user) did something to make it be there, and that something wasn't addgnupghome, because it would have failed then just as it fails now. What was that something and how can I gain manual access to this secret superpower?

Last edited by Donzv (2022-01-26 02:37:51)

Offline

#2 2022-01-26 08:09:03

seth
Member
Registered: 2012-09-03
Posts: 51,165

Re: How does Archlinux initialize ~/.gnupg?

mkdir -m 700 ~/.gnupg 

It's a directory, the interesting things are the files inside - https://wiki.archlinux.org/title/GnuPG
~/.gnupg/gpg.conf can be initialized and maintained w/ gpgconf
If you deleted a private keyring and you used that keyring to encrypt data and you have no backup of that keyring: you are fucked.

Offline

#3 2022-01-26 11:48:32

Donzv
Member
Registered: 2021-03-24
Posts: 7

Re: How does Archlinux initialize ~/.gnupg?

Thanks!

seth wrote:

~/.gnupg/gpg.conf can be initialized and maintained w/ gpgconf

How? I read the manpage, and nothing seems to work. gpgconf --apply-defaults does not result in creation of $GNUPGHOME/gpg.conf. gpgconf --change-options would require me to choose a "component" (probably gpg) and an option to change, and it would probably create the config file if necessary, but it would also change the option, which is not what I intend.

EDIT: The talk page seems to indicate that this is currently borked and one needs to improvise (i.e. copy the skeleton manually from docs, and echo an incantation into dirmngr.conf).

seth wrote:

If you deleted a private keyring and you used that keyring to encrypt data and you have no backup of that keyring: you are fucked.

I haven't really used gnupg for anything before, and it's only for my current project that I started needing not only to use it, but also to teach a script how to set it up in an "interned" environment (i.e. with GNUPGHOME redefined). All I lost were my configuration experiments so far, and that was planned. I wouldn't be deleting ~/.gnupg otherwise.

Last edited by Donzv (2022-01-26 12:12:21)

Offline

Board footer

Powered by FluxBB