gpg script in cron failed with "stdin must be a tty"

Mike Hsu
Fri Aug 8 16:33:02 2003

Finally got it to work with root.

Still having problem with other user.

 DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.12587 installed on Fri Aug  8 07:14:39 2003)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp =
15 07 * * * su - oracle -c
export GNUPGHOME=3D/home/oracle/.gnupg
rm /usr/dba/junk.out
gpg --output /usr/dba/junk.out --batch --no-tty --decrypt =
date > t.log

Mike Hsu (

-----Original Message-----
From: Carl L. Gilbert []
Sent: Friday, August 08, 2003 7:16 AM
To: Mike Hsu
Cc: GnuPG Users Group
Subject: Re: gpg script in cron failed with "stdin must be a tty"

On Thu, 2003-08-07 at 13:07, Mike Hsu wrote:
> A simple gpg script with no passphrase needed:
> gpg --output junk.txt --decrypt junk2.gpg
> runs OK in bash but fails in cron job.

cron uses bash.  You mean it runs OK while you are logged in, but fails
when you attempt to do it without being logged in.

> I get the following message in mail:
> stdin must be a tty

That error message is probably incorrect.

> How can I fix this?
> Mike Hsu (
> _______________________________________________
> Gnupg-users mailing list
Thank you,

CL Gilbert
"Then said I, Wisdom [is] better than strength: nevertheless the poor
man's wisdom [is] despised, and his words are not heard." Ecclesiastes

GnuPG Key Fingerprint:
82A6 8893 C2A1 F64E A9AD  19AE 55B2 4CD7 80D2 0A2D
GNU Privacy Guard (Encryption and Digital