Hi all, I could REALLY use some assistance – I need to encrypt a file with gpg (my Linux server is on version 1.2.6), I need to encrypt it with the public key from our client, and sign it with our private PGP key. I’ve got this all working (I imported their public key, and sent them our key), so I can run a command like this from the command line to encrypt the file:
gpg --armor --output encrypted_file.gpg --recipient "pgpad...@ourclient.com" --local-user "myusern...@mycompany.com" --sign --encrypt file_to_encrypt.txt This works fine (and our client is able to decrypt), but it is prompting for my passphrase each time. We want to set this up to run as an automated process via a script, without prompting for a passphrase. So I was trying to follow the instructions found here: http://www.gnupg.org/faq.html#q4.14 Here are the steps I just ran: 1. I ran the command “gpg --edit-key myusern...@mycompany.com”, then specified “addkey”, selected the DSA key type. It prompted me for my passphrase, and ran successfully, so I saved and quit. 2. I ran the command “gpg --export-secret-subkeys --no-sk-comments > secring.auto” that generated the secring.auto file, that I assume I need to email to the client to import on their side? (when I tried to run it just like in step 3 on the website, I got errors, and not sure if I need to follow steps 4-7?) 3. Now to try and encrypt without a passphrase, I tried this command (same command as above, just added the flag --batch”): a. gpg --batch --armor --output encrypted_file.gpg --recipient "pgpad...@ourclient.com" --local-user myusern...@mycompany.com" --sign --encrypt file_to_encrypt.txt b. And I am seeing this error: $ gpg --batch --armor --output encrypted_file.gpg --recipient "pgpad...@ourclient.com" --local-user "myusern...@mycompany.com" --sign --encrypt file_to_encrypt.txt gpg: can't query password in batchmode gpg: skipped `myusern...@mycompany.com': bad passphrase gpg: file_to_encrypt.txt: sign+encrypt failed: bad passphrase Are you able to help me with this? I appreciate any assistance you can offer, thanks!!! Am I just missing something simple? Am I better off to delete and recreate the keys? Thank you, Brad Blake -- View this message in context: http://old.nabble.com/Need-help-doing-gpg-encryption-without-prompting-for-passphrase-tp29823038p29823038.html Sent from the GnuPG - User mailing list archive at Nabble.com. _______________________________________________ Gnupg-users mailing list Gnupg-users@gnupg.org http://lists.gnupg.org/mailman/listinfo/gnupg-users