yubico-piv-tool: SSH-Agent error on Ubuntu : Could not add card, agent refused operation

Hello,

I’m on Ubuntu 20, up to date, and I’ve followed the steps to make this tool with success and I could generate certificates on my Yubikey 5 via command line.

I’ve looked at the issues here on Github stating the same error I get when I want to use ssh-agent, but without a solution.

When I launch the command ssh-add -s /usr/local/lib/libykcs11.so it prompts me for the PIV password. I enter it and the key doesn’t blink as usually when an action triggers it, and the prompt errors

❯ ssh-add -s /usr/local/lib/libykcs11.so
Enter passphrase for PKCS#11: 
Could not add card "/usr/local/lib/libykcs11.so": agent refused operation

I also tried installing piv-tool via apt, but it still doesn’t work

sudo apt install yubico-piv-tool

How to debug or fix this issue ?

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 19 (11 by maintainers)

Most upvoted comments

@qpernil installed with apt

Package: pcscd
Version: 1.8.26-3
Priority: extra
Section: universe/misc
Source: pcsc-lite
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Ludovic Rousseau <rousseau@debian.org>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 179 kB
Pre-Depends: init-system-helpers (>= 1.54~)
Depends: libccid (>= 1.4.1~) | pcsc-ifd-handler, libc6 (>= 2.15), libsystemd0, libudev1 (>= 183), lsb-base (>= 3.0-6), libpcsclite1 (= 1.8.26-3)
Suggests: systemd
Homepage: https://pcsclite.apdu.fr/
Download-Size: 58,1 kB
APT-Manual-Installed: no
APT-Sources: http://si.archive.ubuntu.com/ubuntu focal/universe amd64 Packages