Skip to content

Instantly share code, notes, and snippets.

View MaxwellDPS's full-sized avatar
🥔
P. O. T. A. T. O.

Max Watermolen MaxwellDPS

🥔
P. O. T. A. T. O.
View GitHub Profile

YubiKey for FIDO2 Auth on WSL2 (Ubuntu)

What?

I got my hands on a new YubiKey 5 over the weekend. For those unaware, this is a pretty well-known security key which provides options for hardware authentication using a variety of different protocols (e.g. FIDO2, OpenPGP etc.). I was keen to try this out for authenticating with GitHub and also handling SSH credentials when accessing servers I'm running on my local network.

The problem however, is that I'm a pretty heavy WSL (Ubuntu) user and needed something which plays well in that environment. I didn't think about it too much when I initially ordered the YubiKey, but worked out over the weekend that getting a USB device (particularly a security key) to play nicely with WSL, isn't exactly straight forward. So, I did a write-up of the steps I ended up taking for others (or myself) to refer back to.

References

@Kranzes
Kranzes / guide.md
Last active October 9, 2025 18:04
SSH Resident Key Guide

Initial checks

Start by checking that there aren't any previous ssh keys inside the FIDO2 authenticator of your YubiKey. You can check if they exist by running the command below:

nix shell nixpkgs#yubikey-manager -c ykman fido credentials list

If the command above outputs a string mentioning "ssh" or "openssh", then you have already got a key generated and store on your YubiKey.

Evaluating additional authentication factors

Before generating a new ssh key to store on your YubiKey you must consider which additional required authentication factors you want to use. Below you can see a table with the available factors and their corresponding command:

@jinschoi
jinschoi / create_sub.py
Last active October 10, 2025 13:09
Python script to generate Flipper RAW .sub files from OOK bitstreams
#!/usr/bin/env python3
from typing import Iterable, Union, Any
# freq: frequency in Hz
# zerolen: length of space bit in μs
# onelen: length of mark bit in μs
# repeats: number of times to repeat sequence
# pause: time to wait in μs between sequences
# bits: string of ones and zeros to represent sequence
@superseb
superseb / k3s-etcd-commands.md
Last active October 14, 2025 03:52
k3s etcd commands

k3s etcd commands

etcd

Setup etcdctl using the instructions at https://github.com/etcd-io/etcd/releases/tag/v3.4.13 (changed path to /usr/local/bin):

Note: if you want to match th etcdctl binaries with the embedded k3s etcd version, please run the curl command for getting the version first and adjust ETCD_VER below accordingly:

curl -L --cacert /var/lib/rancher/k3s/server/tls/etcd/server-ca.crt --cert /var/lib/rancher/k3s/server/tls/etcd/server-client.crt --key /var/lib/rancher/k3s/server/tls/etcd/server-client.key https://127.0.0.1:2379/version
@superseb
superseb / rke2-commands.md
Last active September 29, 2025 13:22
RKE2 commands

RKE2 commands

  • Updated on May 29 to accommodate etcd container not having /bin/sh available anymore.

Install

curl -sL https://get.rke2.io | sh
systemctl daemon-reload
systemctl start rke2-server
@Davnit
Davnit / pulse.py
Created July 22, 2019 16:54
Decrypts and prints incident information from PulsePoint
import base64
import hashlib
import json
from urllib import request
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
from cryptography.hazmat.backends import default_backend
@chriswhong
chriswhong / scrape.js
Created April 22, 2019 03:58
Decrypting Amtrak's real-time train location geoJSON feed
// decrypting Amtrak's real-time train location geoJSON feed
// based on https://github.com/Vivalize/Amtrak-Train-Stats
const fetch = require('node-fetch');
const CryptoJS = require('crypto-js');
// this is the xhr call done by https://www.amtrak.com/track-your-train.html containing encrypted train location data
const dataUrl = 'https://maps.amtrak.com/services/MapDataService/trains/getTrainsData';
// these constants are pulled from RoutesList.v.json, which is an object with keys 'arr', 's', and 'v'
const sValue = '9a3686ac'; // found at s[8]
@TimvanScherpenzeel
TimvanScherpenzeel / unlock-autoplay-audio-video.md
Last active June 4, 2024 03:02
Implementing audio and video autoplay unlocking

Implementing audio and video autoplay unlocking

Due to recent changes in the autoplay policy of Chrome 66 developers of interactive experiences on the web are facing new challenges regarding audio and video autoplay. The new policy has unfortunately broken many of the older experiences that rely on autoplaying audio and video.

So how to move forward?

Previous solutions

Previously developers used to face this issue on iOS mobile devices where the audio context was locked. Most developers fixed this by using the initial touch event of a user to unlock the audio.

@genp
genp / installing_cuda_on_azure_nc_tesla_k80_ubuntu.md
Last active May 30, 2025 21:08 — forked from bzamecnik/installing_cuda_on_azure_nc_tesla_k80_ubuntu.md
Installing NVIDIA CUDA on Azure NC with Tesla K80 and Ubuntu 16.04
@darconeous
darconeous / kidde-interconnect.md
Last active July 27, 2025 16:38
kidde-interconnect

Original "dumb" smoke detector interconnect sounds the siren on all interconnected smoke detectors when a 9-to-12 volt (referenced to neutral/white) direct-current signal is continuously present on the signal wire (red). This still how pretty much all interconnected smoke alarms indicate a fire condition.

However, modern interconnected detectors are capable of detecting carbon monoxide and other conditions. When these conditions are signaled, they must be identified as something other than a smoke alarm by the other detectors. Ideally, any dumb smoke detectors