Computing.Net > Forums > Linux > reading passphrase in a script

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

reading passphrase in a script

Reply to Message Icon

Name: sprang3
Date: October 18, 2004 at 12:18:25 Pacific
OS: Red Hat 9
CPU/Ram: 750
Comment:

I am trying to write a script that types in the gpg passphrase and I can't get it to work I can get the phassphrase to echo back by doing gpg --passphrase-fd 0 | echo passphrase. Does anyone know how I can do this... Thanks...

jsm



Sponsored Link
Ads by Google

Response Number 1
Name: Wolfbone
Date: October 20, 2004 at 06:33:45 Pacific
Reply:

It might help if you piped the output of echo into the input of gpg, rather than the other way around!


0

Response Number 2
Name: sprang3
Date: October 20, 2004 at 07:09:44 Pacific
Reply:

now I have
echo passphrase| gpg --passphrase-fd 0

and I get the following error:
reading passphrase from file descriptor 0
gpg: processing message failed: eof

I even tried cat <filename with passphrase in it> |gpg--passphrase-fd 0

please help thanks

jsm


0

Response Number 3
Name: Wolfbone
Date: October 20, 2004 at 08:28:26 Pacific
Reply:

Perhaps gpg would like to do something useful rather than just read your passphrase - decrypt something for instance?


0

Response Number 4
Name: sprang3
Date: October 25, 2004 at 10:10:07 Pacific
Reply:

I am trying to get it to automatically sign the document and encrypt. I am not sure the correct sytax to do this and everything fail. When I put in

gpg --sign --encrypt uid | echo passphras |gpg --passphrase-fd 0

or echo passphrase | gpg --passphrase-fd 0
gpg --sign --encrypt uid

Can you please help

jsm


0

Response Number 5
Name: Wolfbone
Date: October 25, 2004 at 23:44:05 Pacific
Reply:

echo "passphrase" | gpg -se -u "sign_with_uid" -r "encrypt_for_uid" --passphrase-fd 0 filename


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Linux Forum Home


Sponsored links

Ads by Google


Results for: reading passphrase in a script

backgrounded process id in a script www.computing.net/answers/linux/backgrounded-process-id-in-a-script/28403.html

Script for read files in a director www.computing.net/answers/linux/script-for-read-files-in-a-director/28504.html

Using rsync in a script www.computing.net/answers/linux/using-rsync-in-a-script/27680.html