Re: Crontab running gpg script can’t find secret key

griffmcc gmcclellan at broadmarkasset.com
Thu Feb 3 20:08:34 CET 2011


The user running the cron job is root and the owner of the key is root.

I know this because I added


whoami > whoami.txt


to the script and the contents of the file were "root".


David SMITH-4 wrote:
> 
> griffmcc wrote:
>> Although I can encrypt a file using a script, when crontab runs the same
>> script, it returns the error message “no default secret key: No secret
>> key”. I have one secret key:
>> 
>> sananselmo backupscripts.d # gpg --list-secret-keys
>> /root/.gnupg/secring.gpg
>> ------------------------
>> sec   2048R/AC1E8E28 2011-01-11
>> uid                  Griff McClellan (Broadmark Asset Management) 
>> ssb   2048R/81E9591C 2011-01-11
>> 
>> Here is my script:
>> 
>> gpg -vvv --batch --output /usr/share/tararchive/file.gpg --encrypt –sign
>> /usr/share/tararchive/file.tar.bz2
>> 
>> When I run it I am prompted for a password, even though I have the batch
>> flag. However the file.gpg encrypted file is created. When I run the
>> same script as root using crontab, I get:
>> 
>> gpg: no default secret key: No secret key
>> 
>> Does anyone have any suggestions about how to fix this problem? I tried
>> setting the default-flag in gpg.conf but that didn’t change the outcome.
> 
> Which user ID is the cron script running under?  Is that user the same
> one that owns the key?
> 
> _______________________________________________
> Gnupg-users mailing list
> Gnupg-users at gnupg.org
> http://lists.gnupg.org/mailman/listinfo/gnupg-users
> 
> 

-- 
View this message in context: http://old.nabble.com/Crontab-running-gpg-script-can%E2%80%99t-find-secret-key-tp30831486p30838341.html
Sent from the GnuPG - User mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/attachments/20110203/a6c9817e/attachment-0001.htm>


More information about the Gnupg-users mailing list