Created
November 4, 2022 16:05
-
-
Save joostd/5260a76de984627169530cd52f0e5048 to your computer and use it in GitHub Desktop.
demo for storing SSH certificates on a FIDO security key using largeBlobs
This file contains hidden or 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
| # LargeBlog demo: storing an SSH certificate on a FIDO security key | |
| HID="$(shell fido2-token -L | head -1 | cut -d: -f1-2)" | |
| # uses the first key listed | |
| # note: this is probably specific to an M1 mac | |
| # check if largeBlobs are supported on your key | |
| # Use for instance a YubiKey with 5.5+ firmware | |
| check: | |
| fido2-token -I ${HID} | grep largeBlobs | |
| # CA | |
| id_ca id_ca.pub: | |
| ssh-keygen -t ecdsa -f id_ca | |
| # Generate a eesident SSH key | |
| id_ecdsa id_ecdsa.pub: | |
| ssh-keygen -t ecdsa-sk -f ./id_ecdsa -O resident -N "" | |
| rk: id_ecdsa | |
| #fido2-token -L -r ${HID} | |
| fido2-token -L -k ssh: ${HID} | |
| # ykman fido credentials list | |
| # SSH cert | |
| id_ecdsa-cert.pub: id_ca id_ecdsa.pub | |
| ssh-keygen -s ./id_ca -I [email protected] id_ecdsa.pub | |
| fido2-token -S -b -n ssh: id_ecdsa-cert.pub ${HID} | |
| # large blobs | |
| list: | |
| fido2-token -L -b ${HID} | |
| out.blob: id_ecdsa-cert.pub | |
| fido2-token -G -b -n ssh: out.blob ${HID} | |
| show: out.blob | |
| ssh-keygen -f out.blob -L | |
| # cleanup | |
| clean: delete | |
| -rm id_ca id_ca.pub id_ecdsa id_ecdsa-cert.pub id_ecdsa.pub out.blob | |
| delete: | |
| fido2-token -D -b -n ssh: ${HID} | |
| fido2-token -D -i $(shell fido2-token -Lk ssh: ${HID} | cut -d' ' -f2) ${HID} |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example run: