You are not logged in.

#1 2015-08-11 18:12:07

c0rtex
Member
Registered: 2013-12-23
Posts: 13

Recovering GPG Secret Key [Solved]

Alright I kinda did a major f* up here, changed all permissions (777) system wide, so my system is completely wrecked. I've been able to backup all my data with the exception of my GPG secret key. I chrooted in to Arch from Ubuntu live cd and was able to export my public key without any issue, but with my private key, I got the following error:

gpg: key : error receiving key from agent: No pinentry - skipped 

I imagine its a problem related to permissions. I'm doing my best to read up about this, but I don't know really what to do here.

Last edited by c0rtex (2015-08-11 18:44:02)

Offline

#2 2015-08-11 18:18:07

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,734
Website

Re: Recovering GPG Secret Key [Solved]

I'm confused... can you just chmod 600 ~/.gnupg/*.gpg and try the export again?  What command are you using to export the private key?

EDIT: why not just copy over ~/.gnupg to your new system and fix the permissions... unless I'm missing something, no export/import should be needed, no?

Last edited by graysky (2015-08-11 18:22:08)

Offline

#3 2015-08-11 18:21:58

c0rtex
Member
Registered: 2013-12-23
Posts: 13

Re: Recovering GPG Secret Key [Solved]

graysky wrote:

I'm confused... can you just chmod 600 ~/.gnupg/*.gpg and try the export again?  What command are you using to export the private key?

Here's what I'm using:

 gpg --export-secret-key -a c0rtex > private.key 

Doing that chrooted in to Arch from Ubuntu live cd.

Offline

#4 2015-08-11 18:27:04

c0rtex
Member
Registered: 2013-12-23
Posts: 13

Re: Recovering GPG Secret Key [Solved]

graysky wrote:

EDIT: why not just copy over ~/.gnupg to your new system and fix the permissions... unless I'm missing something, no export/import should be needed, no?

Yeah that did occur to me, I don't have much of an idea of how gpg operates so I don't want to assume that would work and then do a fresh install and lose my keys if it doesn't work.

Offline

#5 2015-08-11 18:32:12

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,734
Website

Re: Recovering GPG Secret Key [Solved]

c0rtex wrote:
graysky wrote:

EDIT: why not just copy over ~/.gnupg to your new system and fix the permissions... unless I'm missing something, no export/import should be needed, no?

Yeah that did occur to me, I don't have much of an idea of how gpg operates so I don't want to assume that would work and then do a fresh install and lose my keys if it doesn't work.

Back up your entire 777 system to a tarball and do not delete it for a few months at least.  Anyway, try the permissions thing and your export command or just copy it over and see what happens.

Offline

#6 2015-08-11 18:43:36

c0rtex
Member
Registered: 2013-12-23
Posts: 13

Re: Recovering GPG Secret Key [Solved]

graysky wrote:
c0rtex wrote:
graysky wrote:

EDIT: why not just copy over ~/.gnupg to your new system and fix the permissions... unless I'm missing something, no export/import should be needed, no?

Yeah that did occur to me, I don't have much of an idea of how gpg operates so I don't want to assume that would work and then do a fresh install and lose my keys if it doesn't work.

Back up your entire 777 system to a tarball and do not delete it for a few months at least.  Anyway, try the permissions thing and your export command or just copy it over and see what happens.


Thanks, thats probably the safest option.

Offline

#7 2018-01-26 20:54:30

zed123
Member
Registered: 2018-01-26
Posts: 9

Re: Recovering GPG Secret Key [Solved]

gpg: key : error receiving key from agent: No pinentry - skipped 

I had a similar issue. This error means that there's an option missing in gpg-agent.conf. The agent needs to know how to ask for the password. There should be someting like this: pinentry-program /usr/bin/pinentry-gtk-2.
https://wiki.archlinux.org/index.php/GnuPG#pinentry

Offline

#8 2018-01-26 23:46:29

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,722

Re: Recovering GPG Secret Key [Solved]

Zed123, Welcome to Arch Linux and thank you for a for a useful first post.  Do be aware of the age of threads; this one is two and a half years old.  I will use this opportunity to go ahead and close this thread.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

Board footer

Powered by FluxBB