Wednesday, June 30, 2010

cygwin and gnupg

I upgraded my installation of cygwin from v1.7. to 1.7.5.  Doing so broke gnupg (v1.4.9, the version that comes with cygwin).  Others have encountered this too.


  $ /usr/bin/gpg --decrypt foo.txt.gpg
  gpg: can't lock memory: Permission denied


My solution - use the native Windows build of gnupg downloaded from gnupg.org.
I had to copy the config over from ${HOME}/.gnupg to ${USERPROFILE}/.gnupg.


  $ /c/programfiles/GNU/GnuPG/gpg --decrypt foo.txt.gpg

  You need a passphrase to unlock the secret key for
  user:


Problem solved.  I will wait till the cygwin distribution gets everything together.  In the meanwhile, I can get on with with my work.

3 comments:

Anonymous said...

Thanks, this helped a lot.

About the only reason I run cygwin these days is for GnuPG (I run Linux in VirtualBox on my Windows 7 host). I guess that now means I have no reason for cygwin any more, and will stick with the native GNUPG.

Anonymous said...

The gpg that comes with cygwin will work, but you MUST have your entries in /etc/passwd and /etc/group

use these commands:
mkpasswd -c >> /etc/passwd
mkgroup -c >> /etc/group

Then gpg works fine

alex said...

Thank you. mkpasswd and mkgroup fixed it.