OSX: How to install gpg without Admin password

Dan Bryant dkbryant at gmail.com
Sun Aug 30 23:15:05 CEST 2015


I had to add the *-program argument to both the gpg and gpg-agent
config files.  Below is very very crude shell script to show others
how it was done.  The script wasn't tested as is, but rather was a
notepad I had open to try to record the steps as I did them.  It is
almost guaranteed to have one or two bus in it.

cd ~
curl -LO ${gpgosx}/GnuPG-2.1.7.dmg
curl -LO ${gpgosx}/GnuPG-2.1.7.dmg.sig
mkdir GnuPG
mkdir GnuPG/tmp
cd ~/GnuPG/tmp
7z x ../../GnuPG-2.1.7.dmg
7z x 4.hfs
tar -xf Install.pkg
cd ..
cat ./tmp/GnuPG.pkg/Payload | gunzip -dc |cpio -i
export PATH=${PATH}:`pwd`/bin
export GNUPGHOME=${HOME}/.gnupg
echo "agent-program" \
  "`pwd`/bin/gpg-agent" \
  > ${GNUPGHOME}/gpg.conf
echo "pinentry-program" \
  "`pwd`/bin/pinentry-mac.app/Contents/MacOS/pinentry-mac" \
  > ${GNUPGHOME}/gpg-agent.conf
# this will start a gpg capable shell

So if anyone is stumbles upon this thread later who is also trying to
get GPG on a Admin controlled Mac, hopefully this will guide the way.

Another path you could take would be to install Chrome and Mailvelope.
I know that Chrome allows "drag-and-drop" install of the browser
without Admin rights.  Once in chrome you can install the Mailvelope
extension which will give you a graphical interface for GPG
operations.  You can also export your Mailvelope key to GPG so you can
do finer manipulation of it through the shell.

Many thanks to Mr. Brunschwig for the tips along the way.

On Sun, Aug 30, 2015 at 9:19 AM, Patrick Brunschwig
<patrick at enigmail.net> wrote:
> You'll need to set the path to pinentry in gpg-agent.conf Something like:
> pinentry-program /home/xyz/pinentry-mac.app/Contents/MacOS/pinentry-mac
> -Patrick
> On 29.08.15 19:13, Dan Bryant wrote:
>> OK, this worked in getting the binaries extracted and by setting PATH
>> and DYNLD_LIBRARY_PATH I can get the bins to load and dump version
>> information... SUCCESS...
>> Now my biggest problem is getting the agent and pinentry (I assume) to
>> talk to gpg.
>> I was hoping I could set bindir, libdir, libexecdir with gpgconf
>> (gpgconf.conf) but I can't seem to figure out how to convice gpg to
>> look in nonstandard paths for binaries and libraries.  Seems to be
>> ignoring PATH environment.
>> Suggestions?
>> On Thu, Aug 27, 2015 at 1:31 AM, Patrick Brunschwig
>> <patrick at enigmail.net> wrote:
>>> On 26.08.15 17:16, Dan Bryant wrote:
>>>> I have a monitored OS X laptop that I would like to put GNU Privacy
>>>> Guard (gpg) on. Of course I can't because I don't have Admin rights,
>>>> but I was hoping there is a way to install it in user space through a
>>>> virtual environment or chroot, or some other wizardry, or by exacting
>>>> the package files.
>>>> Obviously I only need console access to the app.
>>> Just download a DMG file, open (=mount) it, and copy the PKG file to
>>> some temporary location. Then use pkgutil in a terminal to unpack the
>>> PKG file to some temp directory. Then copy whatever you need to your
>>> home directory.
>>> man pkgutil will tell you how to use it.
>>> -Patrick

More information about the Gnupg-users mailing list