Tools for setting up and managing a LUKS partition with Yubikey 2FA.
The current version of these tools is tailored to be run on a NixOS installation media, or on a running NixOS system; However, the actual LUKS configuration itself could be applied to any Linux distribution with a bit of tweaking.
- Boot NixOS installer
- Clone this repo
- Run:
./scripts/ykluks-setup.sh <device> - Run:
nixos-generate-config --root /mnt - Run:
cp yubikey-luks.nix /mnt/etc/nixos/ - Edit
/mnt/etc/nixos/configuration.nix, add./yubikey-luks.nixto imports - Edit
/mnt/etc/nixos/configuration.nixto set up your NixOS system for install. - Run:
nixos-install - Reboot
Once booted into NixOS, clone this repo and run the ykluks-addkey.sh script
as root:
sudo ./scripts/ykluks-addkey.sh