Install required packages

apt-get install pcscd pcsc-utils opensc scdaemon

Install U2F rules

cat > /etc/udev/rules.d/70-u2f.rules << EOF
ACTION!="add|change", GOTO="u2f_end"
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="1050", ATTRS{idProduct}=="0113|0114|0115|0116|0120|0402|0403|0406|0407|0410", TAG+="uaccess"
LABEL="u2f_end"
EOF

Configure GPG

cat > ~/.gnupg/gpg-agent.conf << EOF
pinentry-program /usr/bin/pinentry-gtk-2
enable-ssh-support
EOF

Add line

use-agent

to ~/.gnupg/gpg.conf.

If you’re using GNOME, you should probably disable support for SSH, GPG in Gnome Keyring.

mkdir -p ~/.config/autostart
cp /etc/xdg/autostart/gnome-keyring-{gpg,ssh}.desktop ~/.config/autostart
echo "Hidden=true" >>~/.config/autostart/nome-keyring-{gpg,ssh}.desktop

Feedback / comments?

Ping me (@ypcs) on Twitter