Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I run my backup script as me, it works fine. When I run it as root, it still works, but I get this warning:

gpg: WARNING: unsafe ownership on configuration file `/home/jason/.gnupg/gpg.conf'

What does this warning mean and how can I stop it from happening?

Here's my script:

now=$(date +"%Y-%m-%d-%H-%M-%S")

cat $basedir/email.txt | sendmail -t
sudo rsync -arvz --delete --exclude-from=$basedir/exclude.txt --password-file=$basedir/password.txt / jason@$readynas_address::gob > $logfile
cat $basedir/done-email.txt $logfile | sendmail -t
share|improve this question
I don't see a call to gpg here. Where is it? In db-backup? – Jürgen A. Erhard Jan 19 '11 at 17:28
His sendmail has gpg hooks. – Essobi Jan 19 '11 at 18:36
If my sendmail has gpg hooks, it's not something I set up. I do in fact call gpg in db-backup but forgot to include that part. In any case, Niall's answer took care of the problem. – Jason Swett Jan 19 '11 at 20:00
up vote 3 down vote accepted

This means that anyone who has an account on the system is able to read the contents of /home/jason/.gnupg. You need to run something like the following:

# Change the own of all files within /home/jason/.gnupg to jason
chown -R jason /home/jason/.gnupg
# Make sure only jason can access the various files within.
chmod 700 /home/jason/.gnupg
chmod 600 /home/jason/.gnupg/*
chmod 700 /home/jason/.gnupg/random_seed

I'm not 100% sure, if the last one is needed, but that should get rid of the warning and make sure that only you can read the contents.

share|improve this answer

The gpg key you are using has permissions to be read by people other then the owner.

Chmod the file.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.