You are not logged in.

#1 2016-11-11 04:56:44

physkets
Member
From: India
Registered: 2016-08-22
Posts: 27

[SOLVED] GnuPG key refreshing issues

I get the following errors:

$ gpg2 --refresh-keys 
gpg: connecting dirmngr at '/run/user/1000/gnupg/S.dirmngr' failed: IPC connect call failed
gpg: keyserver refresh failed: No dirmngr

Also,

$ ls -la /run/user/1000/gnupg/S.dirmngr 
srwx------ 1 user1 user1 0 Nov 11 10:18 /run/user/1000/gnupg/S.dirmngr

I don't understand. What is an IPC connect call? And why is it failing?

Last edited by physkets (2016-11-14 11:29:49)

Offline

#2 2016-11-11 08:57:45

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,587

Re: [SOLVED] GnuPG key refreshing issues

There are several threads already posted about a similar issue. Have you tried any of the solutions?

Take a look at this one: https://bugs.archlinux.org/task/42798#comment129967

Offline

#3 2016-11-12 04:49:39

physkets
Member
From: India
Registered: 2016-08-22
Posts: 27

Re: [SOLVED] GnuPG key refreshing issues

x33a wrote:

There are several threads already posted about a similar issue. Have you tried any of the solutions?

Yes, I did try that. Doesn't help. I posted a separate topic because all of them seem to refer to an issue with '/root/.gnupg/S.dirmngr'. Mine is with '/run/user/1000/gnupg/S.dirmngr'.

Last edited by physkets (2016-11-12 04:51:34)

Offline

#4 2016-11-12 18:42:30

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,587

Re: [SOLVED] GnuPG key refreshing issues

They referred to /root because the command involved in those threads is pacman-key, which runs as root, while you are running gpg2 as your own user.

Do you have dirmngr installed?

Try running (without root)

$ dirmngr < /dev/null

Offline

#5 2016-11-13 05:42:41

physkets
Member
From: India
Registered: 2016-08-22
Posts: 27

Re: [SOLVED] GnuPG key refreshing issues

x33a wrote:

Do you have dirmngr installed?
Try running (without root)

$ dirmngr < /dev/null
$ dirmngr < /dev/null 
dirmngr[3609.0]: error opening '/home/user1/.gnupg/dirmngr_ldapservers.conf': No such file or directory
dirmngr[3609.0]: permanently loaded certificates: 0
dirmngr[3609.0]:     runtime cached certificates: 0
dirmngr[3609.0]: failed to open cache dir file '/home/user1/.gnupg/crls.d/DIR.txt': Permission denied
dirmngr[3609.0]: error creating new cache dir file '/home/user1/.gnupg/crls.d/DIR.txt': Permission denied
dirmngr[3609.0]: Fatal: failed to create a new cache object: Configuration error

So then I looked:

$ ls -la .gnupg/crls.d/
ls: cannot access '.gnupg/crls.d/.': Permission denied
ls: cannot access '.gnupg/crls.d/..': Permission denied
ls: cannot access '.gnupg/crls.d/DIR.txt': Permission denied
total 0
d????????? ? ? ? ?            ? .
d????????? ? ? ? ?            ? ..
-????????? ? ? ? ?            ? DIR.txt

What does that mean? Should I create a `dirmngr_ldapservers.conf` in `.gnupg`?

I also use the Seahorse GUI to manage keys. Could that have interfered?

Offline

#6 2016-11-14 03:56:42

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,587

Re: [SOLVED] GnuPG key refreshing issues

Try changing the permissions of that directory and the files inside, as root.

Edit: First run ls -l on that directory as root and see who owns the files.

Offline

#7 2016-11-14 05:54:58

physkets
Member
From: India
Registered: 2016-08-22
Posts: 27

Re: [SOLVED] GnuPG key refreshing issues

[root@host user1]# ls -l .gnupg/crls.d/
total 4
-rw-r--r-- 1 user1 user1 5 Oct 17 12:34 DIR.txt

So that means that it is owned by my user, right? Then what was the problem?

x33a wrote:

Try changing the permissions of that directory and the files inside, as root.

If I do that, won't ownership change to 'root' ?

Offline

#8 2016-11-14 06:16:21

HiImTye
Member
From: Halifax, NS, Canada
Registered: 2012-05-09
Posts: 1,072

Re: [SOLVED] GnuPG key refreshing issues

try

sudo chown -R $USER:$GROUPS $HOME
touch $HOME/.gnupg/dirmngr_ldapservers.conf

and see if that fixes it for you

Offline

#9 2016-11-14 06:38:19

physkets
Member
From: India
Registered: 2016-08-22
Posts: 27

Re: [SOLVED] GnuPG key refreshing issues

HiImTye wrote:

try

sudo chown -R $USER:$GROUPS $HOME
touch $HOME/.gnupg/dirmngr_ldapservers.conf

and see if that fixes it for you

Nope. Still the same:

$ ls -l .gnupg/crls.d/
ls: cannot access '.gnupg/crls.d/DIR.txt': Permission denied
total 0
-????????? ? ? ? ?            ? DIR.txt

A gpg refresh also returns the same old error. So as x33a suggests, should I perform the permission change as root? Do I just use `chown`, or should I specify with `chmod` ?


EDIT: Refreshing returns fewer errors than before, due to creating the ldap file:

$ gpg2 --refresh-keys 
gpg: connecting dirmngr at '/run/user/1000/gnupg/S.dirmngr' failed: IPC connect call failed
gpg: keyserver refresh failed: No dirmngr

Last edited by physkets (2016-11-14 06:59:05)

Offline

#10 2016-11-14 08:40:43

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,587

Re: [SOLVED] GnuPG key refreshing issues

What's the output of

# ls -ld /home/user1/.gnupg/crls.d/

Offline

#11 2016-11-14 09:40:39

physkets
Member
From: India
Registered: 2016-08-22
Posts: 27

Re: [SOLVED] GnuPG key refreshing issues

# ls -ld /home/user1/.gnupg/crls.d/
drw------- 2 user1 user1 4096 Oct 17 12:34 /home/user1/.gnupg/crls.d/

$ ls -ld /home/user1/.gnupg/crls.d/
drw------- 2 user1 user1 4096 Oct 17 12:34 /home/user1/.gnupg/crls.d/

Offline

#12 2016-11-14 11:01:33

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,587

Re: [SOLVED] GnuPG key refreshing issues

There's no execute permission on the directory, that's what's causing the problem.

Run

chmod 700 /home/user1/.gnupg/crls.d/

Offline

#13 2016-11-14 11:28:01

physkets
Member
From: India
Registered: 2016-08-22
Posts: 27

Re: [SOLVED] GnuPG key refreshing issues

x33a wrote:

There's no execute permission on the directory, that's what's causing the problem.

That fixes it! Thanks. Must've messed it up at some point while playing with permissions. But why is that so? Why does that directory need execute permissions?

Offline

#14 2016-11-14 17:58:17

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,587

Re: [SOLVED] GnuPG key refreshing issues

Directories need the execute permission to be always set. But root can still enter a directory without the execute permission. You should read about the Linux permissions system in detail.

Offline

Board footer

Powered by FluxBB