Last active
December 24, 2017 22:33
-
-
Save bannsec/829e6f91bac5fa6dd03f1c636b5ae5af to your computer and use it in GitHub Desktop.
Couple commands to export your ssh-key from a yubikey
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
# Assuming you already generated the private key using some other method, this will extract and create a ssh-key OpenSSH format that can be used for authenticating to openssh. | |
# This is most useful for ECC keys for right now, as ssh-keygen does not read it correctly. | |
# Lists out what keys you have on the device. Note the "ID" of the key you want | |
pkcs15-tool --list-public-keys | |
# Dump it out | |
pkcs15-tool --read-public-key <id> > my_key.pub | |
# Convert it to openssh format | |
ssh-keygen -i -m PKCS8 -f my_key.pub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment