I'm trying to decrypt a file using the following command within a unix shell prompt:

gpg --passphrase-file /path/to/passphrase/file --output /path/to/output/dir/full_db_restore --decrypt full_db_backup_current.tar.gpg

I get the following error when running the command above:

gpg: 3DES encrypted data
gpg: problem with the agent: No pinentry
gpg: encrypted with 1 passphrase
gpg: decryption failed: No secret key

I have verified that pinentry is installed. I'm not sure if pinentry is the issue. I have a feeling it might be with the "No secret key" error. Any help would be appreciated.

link|improve this question
good question but I think it should be moved to superuser, because that's not a programming related question. – Heisenbug May 3 '11 at 14:56
feedback

migrated from stackoverflow.com May 5 '11 at 1:03

This question came from our site for professional and enthusiast programmers.

1 Answer

I've discovered a solution to this.

/usr/bin/gpg --no-tty --batch --passphrase-file /path/to/passphrase/file --output   \
/path/to/output/dir/full_db_restore --decrypt full_db_backup_current.tar.gpg

The only difference is that I've added --no-tty and --batch options. After logging onto my unix server, I switch users from userA to userB. I'm assuming that because I switch users, there was an error. I'm not sure if this is the write solution as the options mentioned above are used when calling the command from a shell script. Any additional information would be greatly appreciated. Thanks in advance.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown