Yubico Forum
https://forum.yubico.com/

[solved] Use same Yubikey with gnupg 2.0 on multiple PC's.
https://forum.yubico.com/viewtopic.php?f=35&t=2308
Page 1 of 1

Author:  x11 [ Sun May 15, 2016 12:03 pm ]
Post subject:  [solved] Use same Yubikey with gnupg 2.0 on multiple PC's.

I created a 4096-bit gpg-key consisting of:
the master-key and 3 sub-keys for signing, decrypting, authenticating on a secure offline-PC.
From that key I exported just the 3 subkeys by:
Code:
gpg --export-secret-subkeys [key-ID] > subkeys

copied subkeys to one of my laptops, imported them into my keyring and on that laptop transferred the subkeys to my Yubikey4.
All works fine and I just have to plug in the Yubikey and enter the Yubikey-password to use my keys for decryptpting, signing and ssh-authentication - GREAT!

Now I want to use the same Yubikey with the same same gpg-keys on a second laptop.
I tried to just copy over the whole ~/.gnupg directory from laptop #1 to laptop #2, but gpg-agent reports "secret key not available". The Yubikey is recognised as I can check with
Code:
gpg2 --card-status


Seems there is some additional information missing - please help.

Kind regards,
x11

Author:  x11 [ Mon May 16, 2016 4:27 pm ]
Post subject:  Re: Use same Yubikey with gnupg 2.0 on multiple computers, L

I just solved it.
Found this information here http://www.narf.ssji.net/~shtrom/wiki/t ... psmartcard
in the paragraph "Using the Card on Multiple Computers"
it suggestes:
Code:
$ gpg2 --card-edit
> fetch
> quit
$ gpg2 --card-status

and that worked fine for me.

In fact, the first part can be omitted, if you have the matching pubkey on your keyring. In that case a
Code:
gpg2 --card-status
is sufficient.
The essential thing is, you have to delete the whole secret key before, only then the stubs get rebuilt:
Code:
gpg2 --delete-secret-key <key-ID>

Regards,
x11

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/