| 1 |
# SPDX-License-Identifier: MIT-0 |
| 2 |
|
| 3 |
# Enroll the security token in the LUKS2 volume. Replace /dev/sdXn by the |
| 4 |
# partition to use (e.g. /dev/sda1). |
| 5 |
sudo systemd-cryptenroll --fido2-device=auto /dev/sdXn |
| 6 |
|
| 7 |
# Test: Let's run systemd-cryptsetup to test if this worked. |
| 8 |
sudo systemd-cryptsetup attach mytest /dev/sdXn none fido2-device=auto |
| 9 |
|
| 10 |
# If that worked, let's now add the same line persistently to /etc/crypttab, |
| 11 |
# for the future. We do not want to use the (unstable) /dev/sdX name, so let's |
| 12 |
# figure out a stable link: |
| 13 |
udevadm info -q symlink -r /dev/sdXn |
| 14 |
|
| 15 |
# Now add the line using the by-uuid symlink to /etc/crypttab: |
| 16 |
sudo bash -c 'echo "mytest /dev/disk/by-uuid/... none fido2-device=auto" >>/etc/crypttab' |
| 17 |
|
| 18 |
# Depending on your distribution and encryption setup, you may need to manually |
| 19 |
# regenerate your initramfs to be able to use a FIDO2 device to unlock the |
| 20 |
# partition during early boot. |
| 21 |
# More information at https://unix.stackexchange.com/a/705809. |
| 22 |
# On Fedora based systems: |
| 23 |
sudo dracut --force |
| 24 |
# On Debian based systems: |
| 25 |
sudo update-initramfs -u |