Ubuntu 16.04 error binding socket

Asked by Jim Genovese on 2017-03-12

Error message when I open terminal window is

gpg-agent[26121]: WARNING: "--write-env-file" is an obsolete option - it has no effect
gpg-agent[26121]: error binding socket to '/home/jim/.gnupg/S.gpg-agent': Permission denied

I am trying to access gnupg on Ubuntu 16.04 and then open gpa. Similar problem with Kleopatra.

I expect to be able to use gpa or Kleopatra to access certificates on the server, to create my own certificate, and to process other gpg certificates.

Question information

English Edit question
GnuPG Edit question
No assignee Edit question
Solved by:
Manfred Hampl
Last query:
Last reply:
Manfred Hampl (m-hampl) said : #1

"error binding socket to '/home/jim/.gnupg/S.gpg-agent': Permission denied"

What is the output of the commands

ls -la /home/jim/.gnupg

Jim Genovese (genovese-jim) said : #2

The response to the command ls -la /home/jim/.gnupg is
jim@jim-Aspire-Z3-710:~$ ls -la /home/jim/.gnugp
ls: cannot access '/home/jim/.gnugp': No such file or directory

If I use the GUI, and cntrl-h I can see it, but it has a lock and when I try to open it I get an error message, you do not have permission to open it.

Hope this is what you were asking

Manfred Hampl (m-hampl) said : #3

There must be a mistyping somewhere.

whst is the output of

ls -lad ~/.gnu*

Jim Genovese (genovese-jim) said : #4

The response to ls -lad ~/.gnu* is
drwx------ 3 root root 4096 Mar 12 22:59 /home/jim/.gnupg

Manfred Hampl (m-hampl) said : #5

As expected. That file is not owned by you, but by root, which is wrong.


sudo chown -R jim:jim ~/.gnupg/

Jim Genovese (genovese-jim) said : #6

I see what you are saying, but when I tried sudo chown -R jim:jim ~/.gnupg/

jim@jim-Aspire-Z3-710:~$ sudo chown -R jim:jim ~/.gnugp
[sudo] password for jim:
chown: cannot access '/home/jim/.gnugp': No such file or directory

I also tried this which I believe should give me a root console
jim@jim-Aspire-Z3-710:~$ sudo -i chown -R jim:jim ~/.gnugp
chown: cannot access '/home/jim/.gnugp': No such file or directory

And got the same response.

Best Manfred Hampl (m-hampl) said : #7

Try again with

ls -lad ~/.gnu*

If you get a file listed, then execute

sudo chown -R jim:jim ~/.gnu*

Jim Genovese (genovese-jim) said : #8

Thank you very much. That worked. I'm not sure why but I will try to research it. Many thanks for sharing your expertise.

Jim Genovese (genovese-jim) said : #9

Thanks Manfred Hampl, that solved my question.