Skip to content

Instantly share code, notes, and snippets.

@brettowe
brettowe / fido-shutdown.py
Created May 4, 2022 21:28
script that uses a yubikey on headless machines without a power button to initialize shutdown
#!/usr/bin/env python3
# this script listens for a yubikey to be plugged into a device and shutdown if the button is pressed on it
# handy for headless devices that have no power buttons but need to be shutdown
# no verification is done to see if its an authorized yubi key
# changelog
# 20220504 - initial release
import functools
import os.path