Skip to content

Instantly share code, notes, and snippets.

@lrvick
Last active August 18, 2016 00:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lrvick/d1a5a8e6cf0eefda69d7 to your computer and use it in GitHub Desktop.
Save lrvick/d1a5a8e6cf0eefda69d7 to your computer and use it in GitHub Desktop.
udev to kill/restart scdaemon on yubikey insertion for ssh/gpg
# Yubico Yubikey
ATTRS{idVendor}=="1050", \
ATTRS{idProduct}=="0010|0405|0110|0111|0116", \
ENV{ID_SECURITY_TOKEN}="1", \
RUN+="/bin/bash -c '/usr/bin/killall -9 scdaemon'", \
TAG+="uaccess"
LABEL="yubico_end"
@daurnimator
Copy link

Save as /etc/udev/rules.d/88-yubikey.rules
Then run sudo udevadm control -R

@josselin-c
Copy link

For information, I have a YubiKey 4 with idProduct 405, you may want to check yours and adapt the rules file
[user@~]$ lsusb
Bus 001 Device 016: ID 1050:0405 Yubico.com

@KellerFuchs
Copy link

Why bash -c '/usr/bin/killall -9 scdaemon'? That's pretty redundant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment