gpg: WARNING: unsafe ownership on homedir

Ira.Kirschner at Ira.Kirschner at
Wed Jun 5 02:24:39 CEST 2013

Perfectly simple explanation of what I was doing wrong. Works fine now. Much appreciated.

-----Original Message-----
From: Gnupg-users [mailto:gnupg-users-bounces at] On Behalf Of Branko Majic
Sent: Tuesday, June 04, 2013 4:43 PM
To: gnupg-users at
Subject: Re: gpg: WARNING: unsafe ownership on homedir

On Tue, 4 Jun 2013 19:22:04 +0000
<Ira.Kirschner at> wrote:

> I have researched this error message and have found the suggestions do not work. Does anyone know how to have this warning message stop?
> I am getting the message:   gpg: WARNING: unsafe ownership on homedir `/home/wsc_gpg/.gnupg'
> User wsc_gpg owns the gpg installation.
> The process is running from root as:
> sudo -u wsc_gpg cat /home/wsc_gpg/.gnupg/cache.txt | gpg --homedir /home/wsc_gpg/.gnupg --batch --yes --no-mdc-warning --skip-verify --passphrase-fd 0 --no-secmem-warning -o $OUTPUTFILE -d $ENCRYPTEDFILE

Ok, so the catch here is that the first command in the line is being
run as user wsc_gpg, but not the subsequent ones. You want want to put
a sudo -u wsc_gpg in front of the second gpg command in the pipeline as
well (otherwise it'll still run as root, and gpg will complain
about .gnupg directory not being owned by root).

Best regards

Branko Majic
Jabber: branko at
Please use only Free formats when sending attachments to me.

Бранко Мајић
Џабер: branko at
Молим вас да додатке шаљете искључиво у слободним форматима.

More information about the Gnupg-users mailing list