Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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")
logfile="/var/log/backups/rsync-$now"
readynas_address="192.168.140.31"
basedir="/home/jason/scripts/backup"

cat $basedir/email.txt | sendmail -t
/home/jason/scripts/db-backup
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

2 Answers 2

up vote 2 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

 
discard

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.