]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/fido2-crypttab.sh
meson: move systemd-cryptsetup to /usr/bin
[thirdparty/systemd.git] / man / fido2-crypttab.sh
CommitLineData
1fe6d37e 1# SPDX-License-Identifier: MIT-0
f4d74c61 2
cf1e172d
LP
3# Enroll the security token in the LUKS2 volume. Replace /dev/sdXn by the
4# partition to use (e.g. /dev/sda1).
5sudo systemd-cryptenroll --fido2-device=auto /dev/sdXn
6
7# Test: Let's run systemd-cryptsetup to test if this worked.
fb8d67cd 8sudo systemd-cryptsetup attach mytest /dev/sdXn - fido2-device=auto
cf1e172d
LP
9
10# If that worked, let's now add the same line persistently to /etc/crypttab,
12c346d8
ZJS
11# for the future. We don't want to use the (unstable) /dev/sdX name, so let's
12# figure out a stable link:
13udevadm info -q -r symlink /dev/sdXn
c9bb40b1 14
12c346d8
ZJS
15# Now add the line using the by-uuid symlink to /etc/crypttab:
16sudo bash -c 'echo "mytest /dev/disk/by-uuid/... - 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.
c9bb40b1
R
22# On Fedora based systems:
23sudo dracut --force
24# On Debian based systems:
25sudo update-initramfs -u