Frequently Asked Questions

How to setup Yubikey on Linux
Last Updated a year ago

sudo apt-get install opensc

sudo apt-add-repository ppa:yubico/stable

sudo apt-get install yubico-piv-tool

yubico-piv-tool -s 9a -a generate -o public.pem

yubico-piv-tool -a verify-pin -P 123456 -a selfsign-certificate -s 9a \
-S "/CN=SSH key/" -i public.pem -o cert.pem

yubico-piv-tool -a import-certificate -s 9a -i cert.pem

ssh-keygen -D $OPENSC_LIBS/opensc-pkcs11.so


ssh -I $OPENSC_LIBS/opensc-pkcs11.so user@remote.example.com




#Change Pin

yubico-piv-tool -a change-pin -P 123456 -N TheNewPinHere

yubico-piv-tool -a change-puk -P 12345678 -N TheNewPinHere


OR

vi /etc/ssh/ssh_config

#For Ubuntu
PKCS11Provider /usr/lib/x86_64-linux-gnu/opensc-pkcs11.so

#Get Key

ssh-keygen -D /usr/lib/x86_64-linux-gnu/opensc-pkcs11.so



#For Ubuntu 32bit

PKCS11Provider /usr/lib/i386-linux-gnu/opensc-pkcs11.so



#For Arch

PKCS11Provider /usr/lib/opensc-pkcs11.so

#For Fedora
/usr/lib64/opensc-pkcs11.so

Please Wait!

Please wait... it will take a second!