Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 02-07-2014, 10:40 PM   #1
Registered: Jun 2003
Location: Summit, NJ
Distribution: CentOS 5.4
Posts: 124

Rep: Reputation: 15
Angry weird gpg error

Hey all,

I run a mac at home and wanted to be able to access my gpg keypair from a remtote Linux host (centos 6.5). So apparently I made a mistake by rsync'ing my .gnupg directory from my home on the mac to the remote host.

Because even tho I can list keys on the remote host:

[root@monitor:~/creds/scalr] #gpg --list-keys
pub   1024D/F186197B 2010-11-30
uid                  Tim Dunphy <>
uid                  Tim Dunphy <>
uid                  Tim Dunphy <>
uid                  Tim Dunphy (MLB Work e-mail) <>
sub   2048g/B712B288 2010-11-30

pub   2048R/C059E8CD 2010-11-30 [revoked: 2012-12-27]
uid                  Tim Dunphy <>

pub   4096R/4BD6EC30 2010-07-10 [expired: 2012-07-09]
uid                  Puppet Labs Release Key (Puppet Labs Release Key) <>

pub   4096R/6F60D626 2012-12-27 [revoked: 2012-12-27]
uid                  Tim Dunphy <>
I cannot decrypt or encrypt messages. When I try to decrypt this is the error I get:

[root@monitor:~/creds/scalr] #gpg -d scalr-creds.asc

You need a passphrase to unlock the secret key for
user: "Tim Dunphy <>"
2048-bit ELG key, ID B712B288, created 2010-11-30 (main key ID F186197B)

can't connect to `/root/.gnupg/S.gpg-agent': No such file or directory
gpg-agent[16157]: can't connect server: `ERR 67109133 can't exec `/usr/local/MacGPG2/libexec/': No such file or directory'
gpg-agent[16157]: can't connect to the PIN entry module: IPC connect call failed
gpg-agent[16157]: command get_passphrase failed: No pinentry
gpg: problem with the agent: No pinentry
gpg: encrypted with 2048-bit ELG key, ID B712B288, created 2010-11-30
      "Tim Dunphy <>"
gpg: public key decryption failed: General error
gpg: decryption failed: No secret key

As you can see, the error is referring to a Macintosh directory. Which must have something to do with the fact that the keypair I was trying to use was generated on a mac.

I've even tried starting fresh on that host by rm -rf'ing the .gnupg directory in my home directory. But it's no luck even after I create a fresh keypair. I get the same message when I try to encrypt or decrypt.

Here are listings of my .gnupg directory in case this might shed any clues as to why this is happening:

[root@monitor:~/creds/scalr] #ls -ld ~/.gnupg
drwxr-xr-x 3 root root 4096 Feb  7 23:30 /root/.gnupg

[root@monitor:~/creds/scalr] #ls -l ~/.gnupg/
total 52
-rw-r--r-- 1 root root  107 Feb  2 11:59 gpg-agent.conf
-rw-r--r-- 1 root root 9087 Feb  2 11:59 gpg.conf
drwxr-xr-x 2 root root 4096 Feb  2 11:59 private-keys-v1.d
-rw-r--r-- 1 root root 8260 Feb  2 11:59 pubring.gpg
-rw-r--r-- 1 root root  600 Feb  2 11:59 random_seed
-rw-r--r-- 1 root root 9355 Feb  2 11:59 secring.gpg
-rw-r--r-- 1 root root 1480 Feb  2 12:00 trustdb.gpg

Any help here would be _definitely_ appreciated.

Old 02-10-2014, 01:04 PM   #2
Senior Member
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Question: is an acceptable solution for you to export the keys / ownertrust from your Mac to the Linux server?

If so, on the Mac:
$ gpg --export >
$ gpg --export-secret-keys >
$ gpg --export-ownertrust >
Transfer the files to the Linux server.

Then, on the Linux server (after taking a backup, if needed, and then removing the ~/.gnupg directory):
$ gpg --import
$ gpg --import
$ gpg --import-ownertrust



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
gpg / gpg-agent -- Can't connect to /root/.gnupg/S.gpg-agent jrtayloriv Linux - Security 8 05-11-2017 09:34 AM
Update manager error: GPG error: ... signatures ... Nonc Linux - General 0 08-18-2010 06:36 PM
GPG: Bad session key gpg between gpg on linux and gpg gui on windows XP konqi Linux - Software 1 07-21-2009 09:37 AM
isn't it weird that the DAG repository GPG key thing won't? t3gah Fedora 3 04-19-2005 01:29 AM
GPG error? koyi Linux From Scratch 1 05-06-2004 09:23 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:06 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration