Skip to content

Udev rules is not correct for Yubico.com Yubikey 4/5 OTP+U2F+CCID on Ubuntu 23.04

By default sudo ./yubico_helper udev -e writes :

##### BEGIN YUBICO HELPER #####
ACTION=="remove", ENV{ID_BUS}=="usb", ENV{ID_MODEL_ID}=="1031", ENV{ID_VENDOR_ID}=="1050", RUN+="/bin/loginctl lock-sessions"
###### END YUBICO HELPER ######

into /etc/udev/rules.d/20-yubikey.rules.

While lsusb returns

Bus 001 Device 040: ID 1050:0407 Yubico.com Yubikey 4/5 OTP+U2F+CCI.

The device id is different and the session lock on key removal does not work.

If I switch the ID_MODEL_ID from 1031 to 0407, it works after a udev rules reload sudo udevadm control --reload-rules

HTH