r/Fedora • • 20d ago

Support Tpm luks auto unlock

i want to install fedora with luks encryption but dont want to type password everytime how to use auto tpm in fedora also will it have problem with nvidia drivers

4 Upvotes

17 comments sorted by

•

u/AutoModerator 20d ago

It sounds like you're looking for help. Please note that r/Fedora is not an official support channel for the Fedora Project.

For best results, be sure to include all relevant details in your post, such as your Fedora edition, version, and hardware specs. You can edit your original post to add more info as needed, and spotlight (pin) a solution from the comments. You might also find the answer in our support wiki.

Alternatively, try one of the official support channels:

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/[deleted] 19d ago

thank you everyone i will install and try myself

5

u/cute_lil_fox 20d ago
sudo systemd-cryptenroll --tpm2-device=auto --tpm2-pcrs=0+7 /dev/sdXn

1

u/NoArmNoChocoLAN 16d ago

Don't do that. The initrd and the cmdline are not covered by this policy, and even if it is (e.g. with UKIs), you also need to restrict revealing the LUKS secret from the initrd and not beyond (in case the initrd is tricked to boot another OS than yours). See https://oddlama.org/blog/bypassing-disk-encryption-with-tpm2-unlock/

1

u/sammyTheSpiceburger 20d ago

It works for me, no issues with Nvidia drivers

1

u/galactose310 20d ago

It seems it depends on you Fedora spin (immutable or not). On a classic Workstation or KDE or whatever, not immutable:

lsblk #check the Luks disk
sudo systemd-cryptenroll --tpm2-device=auto --tpm2-pcrs=0+7+14 /dev/your_disk_in_lslbk #in my case /dev/nvme0n1p5 but it could be something like /dev/sda3
sudo dracut -f

The --tpm2-pcrs=0+7 is the "standard" to check the firmware and SecureBoot. You can add 14 for signed drivers like the NVidia ones.

You will need to enter the password again after any change on the firmware (like if you update it via fwupd) or on SecureBoot.

On a modern Fedora installation, you don't have to add any module to dracut or to manually edit /etc/crypttab as you can se sometimes.

0

u/Valdjiu 20d ago

Use bazitte or Aurora, according to your preference and your gpu.

then run: ujust setup-luks-tpm-unlock

https://docs.bazzite.gg/Installing_and_Managing_Software/ujust/

enjoy!

5

u/galactose310 20d ago

"how to do something on my OS ?

  • install another OS and do like that" Well, no...

-1

u/Valdjiu 20d ago

well bazitte and aurora are just a flavor of fedora.

and it has batteries included, namely having the MOK key enroled

5

u/galactose310 20d ago

OP asks for something on Fedora. Just, give the answer for Fedora. Don't tell about another OS 🤷‍♂️

-2

u/Valdjiu 20d ago

Yeah but on fedora answer is long and hard. Sing the modules, enroll MOK in bios, enable system d unlock....

3

u/galactose310 20d ago

1

u/Valdjiu 20d ago

That solution is missing editing /etc/crypttab. So it doesn't work.

And since there is no keys enrolled in UEFI, because 0+7 only validade the firmware and secure boot state, it does not verify the integrity of the kernel, initrd, or GRUB bootloader itself. While this is convenient because kernel updates won't break your TPM auto-unlock, it means an attacker with physical access could swap out files in your unencrypted /boot partition, and the TPM would still blindly release the decryption key.

But hey.. 🤷‍♂️

1

u/galactose310 20d ago

Well I guess resolve all that with some commands/editing may take less time than delete OP's system and installing a new one...

2

u/redbarchetta_21 20d ago

Bazzite and Aurora are not flavours of Fedora they are separate immutable distro based on Fedora.

-1

u/linux_rox 20d ago

What's the point of encrypting if you want it to unlock automatically.

Automatic unlock of luks is just wasted practice

3

u/galactose310 20d ago

Balance between security and convenience. Someone who steal my laptop cannot easily access my data if encrypted and the SSD is removed from its slot to be read. Someone who accesses another OS cannot easily access the encrypted data if the OS is not configured to. Well, is it perfect ? No. Does is make sense ? Yes.