Discussion:
[arch-general] fail to export gpg private key
arnaud gaboury via arch-general
2016-07-06 12:06:41 UTC
Permalink
I have successfully created a gpg key pair on one of my computer. I
would like to use the same pair on another computer, so the need to
export. Here are the commands:

$ gpg --output tth_pub.gpg --armor --export KeyID

Results in
-rw-rw-r-- 1 poisonivy poisonivy 1.7K Jul 6 13:34 tth_pub.gpg

Fine. Now with private one:

$ gpg --output tth_sec.gpg --armor --export-secret-key KeyID
gpg: WARNING: nothing exported

I have the tth_sec.pgp but with size of zero.

What do I wrong?


gpg-agent is running :
67:poisoni+ 23911 1 0 13:41 ? 00:00:00 gpg-agent --homedir
/home/poisonivy/.config/gnupg --use-standard-socket --daemon

gpg.conf
-------------
no-greeting
homedir ~/.config/gnupg
use-agent
default-key 92AB63D5
charset utf-8
utf8-strings
armor
keyserver pgp.mit.edu
keyserver-options auto-key-retrieve

gpg-agent.conf
---------------------
homedir ~/.config/gnupg
allow-preset-passphrase

Thank you for help.
--
google.com/+arnaudgabourygabx
Jens Adam
2016-07-06 12:36:37 UTC
Permalink
Post by arnaud gaboury via arch-general
$ gpg --output tth_sec.gpg --armor --export-secret-key KeyID
gpg: WARNING: nothing exported
I have the tth_sec.pgp but with size of zero.
What do I wrong?
Are you doing this via ssh? In that case gpg-agent/pinentry often cause problems.
Try again with:

$ GPG_TTY=$(tty) gpg --output tth_sec.gpg --armor --export-secret-key KeyID


—byte
arnaud gaboury via arch-general
2016-07-06 12:46:55 UTC
Permalink
Post by Jens Adam
Post by arnaud gaboury via arch-general
$ gpg --output tth_sec.gpg --armor --export-secret-key KeyID
gpg: WARNING: nothing exported
I have the tth_sec.pgp but with size of zero.
What do I wrong?
Are you doing this via ssh? In that case gpg-agent/pinentry often cause problems.
$ GPG_TTY=$(tty) gpg --output tth_sec.gpg --armor --export-secret-key KeyID
NO ssh.

I just found the reason when running $ gpg --list-secret-keys. The
command returned empty! Permission was set to 600 for items inside the
gnupg folder. Setting permission to 700 for sub directories fixed it.

$ ls
......
-rw------- 1 poisonivy poisonivy 1.7K Jul 6 13:34 tth_pub.gpg
-rw------- 1 poisonivy poisonivy 3.6K Jul 6 14:46 tth_sec.gpg
Post by Jens Adam
—byte
--
google.com/+arnaudgabourygabx
Ben Oliver via arch-general
2016-07-06 13:01:50 UTC
Permalink
This may or may not be related, but a recent caused lots of permissions
errors
in my gnupg homedirs. Happened on three machines.

Loading...