How to perform gpg --decrypt on command line (instead of gui asking for passphrase)?

Detmar Meurers's Avatar

Detmar Meurers

12 Sep, 2012 10:24 AM

Hi,

I recently switched from my own installation to gpgtools. It's great
that this is now more readily available on the Mac - thanks!

One problem I now have, though, is that instead of being prompted for
the password on the command line, calling "gpg somefile.gpg" now
starts a gui window "Pinentry Mac" - which e.g. means I can no longer
decrypt files on machines that I only logged on remotely. How can I
switch off the graphical frontend for keyword entry?

All the best,
Detmar

  1. 1 Posted by cfraire on 16 Sep, 2012 04:46 PM

    cfraire's Avatar

    There is an environment variable to control this. Try the following block in the .bashrc of accounts you log on to with ssh:

    if test "$SSH_CONNECTION" != ""
    then
      export PINENTRY_USER_DATA="USE_CURSES=1"
    fi
    

    "USE_CURSES=1" deactivates the pinentry popup; the test deactivates it only for ssh sessions.

  2. 2 Posted by Detmar Meurers on 17 Sep, 2012 09:11 AM

    Detmar Meurers's Avatar

    Thanks cfaire. I tried this out by typing
    export PINENTRY_USER_DATA="USE_CURSES=1" into a bash shell and then calling "gpg somefile.gpg" - but it still opens the pinentry popup (using gpg (GnuPG/MacGPG2) 2.0.18). Any hints on why it doesn't have the effect you assumed?

  3. Support Staff 3 Posted by Luke Le on 17 Sep, 2012 09:33 AM

    Luke Le's Avatar

    Hi Detmar,

    please install the MacGPG2 Version from http://nightly.gpgtools.org
    That one should work as described by cfraire

  4. Luke Le closed this discussion on 17 Sep, 2012 09:33 AM.

  5. Luke Le re-opened this discussion on 17 Sep, 2012 09:34 AM

  6. Support Staff 4 Posted by Luke Le on 09 Oct, 2012 09:25 PM

    Luke Le's Avatar

    Closing due to inactivity.
    Please feel free to re-open.

  7. Luke Le closed this discussion on 09 Oct, 2012 09:25 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac