LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 02-07-2014, 11:40 PM   #1
bluethundr
Member
 
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:


Code:
[root@monitor:~/creds/scalr] #gpg --list-keys
/root/.gnupg/pubring.gpg
------------------------
pub   1024D/F186197B 2010-11-30
uid                  Tim Dunphy <bluethundr@somewhere.com>
uid                  Tim Dunphy <bluethundr@somewhere.com>
uid                  Tim Dunphy <tdunphy@somewhere.com>
uid                  Tim Dunphy (MLB Work e-mail) <tim.dunphy@somewhere.com>
sub   2048g/B712B288 2010-11-30

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

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

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

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

You need a passphrase to unlock the secret key for
user: "Tim Dunphy <bluethundr@somewhere.com>"
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/pinentry-mac.app/Contents/MacOS/pinentry-mac': 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 <bluethundr@somewhere.com>"
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:



Code:
[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.

Thanks!
 
Old 02-10-2014, 02:04 PM   #2
anomie
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:
Code:
$ gpg --export > key.here
$ gpg --export-secret-keys > secret-key.here
$ gpg --export-ownertrust > trust-db.here
Transfer the files to the Linux server.

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


Reply

Tags
gpg


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 7 10-20-2015 04:27 PM
Update manager error: GPG error: http://ppa.launchpad.net ... signatures ... Nonc Linux - General 0 08-18-2010 07:36 PM
GPG: Bad session key gpg between gpg on linux and gpg gui on windows XP konqi Linux - Software 1 07-21-2009 10:37 AM
isn't it weird that the DAG repository GPG key thing won't? t3gah Fedora 3 04-19-2005 02:29 AM
GPG error? koyi Linux From Scratch 1 05-06-2004 10:23 AM


All times are GMT -5. The time now is 03:18 AM.

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