Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

I'm trying to encrypt a .tar.gz with a passphrase from a shell script. I've tried gpg2 --passphrase whatever -c but then gnupg-agent pops up a dialog asking for a password.

Never used GnuPG before so i know nothing about it.

share|improve this question
--batch (15 characters) – new123456 Jan 13 '11 at 18:31
It's better not to pass passwords as arguments. Use gpg --passphrase-file filename instead. – Dennis Williamson Jan 13 '11 at 19:51
--batch --passphrase did the job. Knew about passphrase-file but i gain nothing from it. – ggustafsson Jan 13 '11 at 22:33
up vote 1 down vote accepted

The answer is --batch flag. User new123456 commented above.

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.