Last active
February 3, 2018 22:14
-
-
Save Wesseldr/964e88b531f4583decb34fec552c93e9 to your computer and use it in GitHub Desktop.
PKCS#11 and ssh-agent, ask smartcard (YubiKey) pin code if not yet added, else do not add smart card again to ssh-agent
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add this to your .profile or .bash_profile, Tested on OsX 10.12, untested on Debian & Linux. | |
# Check if OpenSC smartcard is already added to an empty ssh-agent than add smart card, else skip this | |
ssh-add -L | grep "The agent has no identities" > /dev/null | |
if [ $? -eq 0 ]; then | |
ssh-add -s /usr/local/lib/opensc-pkcs11.so | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment