You are not logged in.

#1 2019-04-21 13:20:18

madpet
Member
Registered: 2018-06-21
Posts: 16

Trying to get SSH by GPG working with an OpenPGP smartcard (NitroKey)

Hey, I have a NitroKey Pro, which is essentially just an OpenPGP smartcard like YubiKey.
It has my GPG keys on it which I use at work to authorize myself when ssh'ing into remote servers.

However, I cannot for the life of me get it to work with my home Arch box.

- The card is shown correctly when I do

gpg2 --card-status

- Trying to do

ssh (server)

gives the error message

sign_and_send_pubkey: signing failed: agent refused operation

- However, doing

ssh-add -L

correctly displays the SSH key from the smartcard
- ...and I've made sure that

$SSH_AUTH_SOCK

is the value of

"$(gpgconf --list-dirs agent-ssh-socket)"

which in my case is

/run/user/1000/gnupg/S.gpg-agent.ssh

- My

~/.gnupg/gpg.conf

contains the line

use-agent

- My

~/.gnupg/gpg-agent.conf

contains both the line

pinentry-program /usr/bin/pinentry

(which is installed) and the line

enable-ssh-support

On my iMac I have to do two extra steps whenever I open a new terminal, namely:
1.

echo UPDATESTARTUPTTY | gpg-connect-agent

2.

killall gpg-agent && gpg-agent --daemon --pinentry-program /usr/local/bin/pinentry &

...but they don't seem to work here (even with the correct pinentry path)

What am I missing here? Why is the ssh-agent (which, I reckon, is actually gpg-agent) refusing to cooperate with the actual SSH operation?

Offline

#2 2019-04-22 12:15:54

madpet
Member
Registered: 2018-06-21
Posts: 16

Re: Trying to get SSH by GPG working with an OpenPGP smartcard (NitroKey)

I found the solution: I needed to set the correct TTY for pinentry as described here: https://wiki.archlinux.org/index.php/Gn … orrect_TTY

Offline

#3 2019-04-22 13:46:57

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,645

Re: Trying to get SSH by GPG working with an OpenPGP smartcard (NitroKey)

Please remember to mark your thread [SOLVED] (edit the title of your first post).

Offline

#4 2019-05-06 14:37:03

madpet
Member
Registered: 2018-06-21
Posts: 16

Re: Trying to get SSH by GPG working with an OpenPGP smartcard (NitroKey)

2ManyDogs wrote:

Please remember to mark your thread [SOLVED] (edit the title of your first post).

I cannot do that as apparently that would make the title longer than is allowed hmm

Offline

Board footer

Powered by FluxBB