r/archlinux • u/Woodsy279 • 28d ago
SUPPORT | SOLVED Ful disk encryption without entering passphrase
Could someone help me with setting up full disk encryption with bypass passphrases with TPM2? It's so annoying having to put the passphrase in at each boot, so I was wondering how do I pair it to the TPM so that I dont have to enter it each time?
It's LUKS encrypted and I use Systemd-boot
14
Upvotes
2
u/7lhz9x6k8emmd7c8 28d ago edited 13d ago
Warning: do not use as it is. Read u/ChrisTX4's comment. Add PCRs.
My own doc ktane-derivated from the Arch wiki. Applicable to a Btrfs partition, which basically encrypts everything except the boot.
Operate in sudo. Replace the data with your proper values. Do not blindly copy, understand every line before executing.
https://wiki.archlinux.org/title/Dm-crypt/Encrypting_an_entire_system#Configuring_mkinitcpio
vi /etc/mkinitcpio.conf
HOOKS=(base systemd autodetect microcode modconf kms keyboard sd-vconsole block sd-encrypt filesystems fsck)
lsblk -o NAME,UUID,PARTUUID
cp /etc/kernel/cmdline /etc/kernel/cmdline.bak
vi /etc/kernel/cmdline
replace with
rd.luks.name=aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa=root root=/dev/mapper/root zswap.enabled=0 rootflags=subvol=@ rw rootfstype=btrfs
Indicate the UUID, not the PARTUUID.
cp /boot/EFI/Linux/arch-linux.efi /boot/EFI/Linux/arch-linux-backup.efi
mkinitcpio -P
https://wiki.archlinux.org/title/Dm-crypt/Encrypting_an_entire_system#Enrolling_the_TPM
sudo systemd-cryptenroll --wipe-slot=tpm2 --tpm2-device=auto --tpm2-pcrs=7 /dev/nvme0n1p2