I recently switched to Linux (Zorin OS) and I selected “use ZFS and encrypt” during installation. Now before I can log in it asks me “please unlock disk keystore-rpool” and I have to type in the encryption password it before I’m able to get to the login screen.

Is there a way to do this automatically like with Windows or MacOS? Zorin has biometric login which is nice but this defeats the purpose especially because the encryption password is long and tedious to type in.

Also might TPM have anything to do with this?

EDIT: Based on the responses I have to assume some of you guys live in windowless underground bunkers sealed off with concrete because door locks “aren’t secure against battering rams”. Normal people don’t need perfect encryption they just want to add an extra hurdle or two for the crackhead who steals the PC. I assumed Linux had a system similar to what Windows or MacOS has been doing for a decade but I am apparently wrong.

  • NaN@lemmy.sdf.org
    link
    fedilink
    English
    arrow-up
    0
    ·
    edit-2
    7 months ago

    Fedora has a good write up using Clevis, I am not sure how well Ubuntu supports it as they traditionally have been against using the TPM for security reasons. https://fedoramagazine.org/automatically-decrypt-your-disk-using-tpm2/

    systemd-cryptenroll can do it very quick and easy, it’s literally about two minutes work, but Ubuntu patches out the TPM support.

    Ubuntu will soon have TPM-backed full disk encryption as a standard option in the installer. Their implementation is designed to defeat most of the security implications that the naysayers bring up, except the login process is still a potential vulnerability. What you are asking about is not so far fetched as some of the comments would lead you to believe: https://ubuntu.com/blog/tpm-backed-full-disk-encryption-is-coming-to-ubuntu

  • deafboy@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    7 months ago

    There used to be exactly what you are looking for. Encfs, and later ecryptfs could encrypt just the data in your home folder.

    It was a checkbox in ubuntu installer, just like the full disk encryption today. The key was protected by the standard user password.

    Unfortunately, it was deprecated due to discovered security weaknesses, and I’m not aware of any viable replacement.

  • Saff@lemmy.ml
    link
    fedilink
    arrow-up
    0
    ·
    7 months ago

    Instead of encrypting the entire drive, encrypt the home folder. That way it’s unlocked when you sign in.

  • SethranKada@lemmy.ca
    link
    fedilink
    English
    arrow-up
    0
    ·
    7 months ago

    I think people are misunderstanding the whole point of drive encryption. It’s so that if the drive is stolen or lost, you don’t have to worry about it as much. I personally don’t see any benefit in doing this if I have to enter a password every time I plug the damn thing in. If you’re concerned about somebody stealing your laptop or desktop, the disk-encryption should be the least of your worries.

    To the OC; if you happen to use GNOME, then check out the settings in the DISKS app. It has auto-unlock options in the per-drive settings. I long ago configured it so my USB is auto-unlocked upon being plugged in. Though after several system resets and such whatever I did to do that seems to no longer be visible in the GUI, I know that’s how I set it up in the first place.

    • Jediwan@lemy.lolOP
      link
      fedilink
      arrow-up
      0
      ·
      edit-2
      7 months ago

      To the OC; if you happen to use GNOME, then check out the settings in the DISKS app. It has auto-unlock options in the per-drive settings.

      Thanks so much!

      EDIT: This didn’t work

    • PainInTheAES@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      7 months ago

      They do understand the point. The problem is that if you use TPM to unlock on boot it is slightly self defeating. Now the attacker has access to your display manager or TTY. They can guess passwords, try to bypass the biometric checks, or find an exploit. But that does indicate a higher tech level that your average thief.

      • Jediwan@lemy.lolOP
        link
        fedilink
        arrow-up
        0
        ·
        7 months ago

        I appreciate the concern but odds are if someone is stealing my PC its not going to be a 1337 hax0r. I am not keeping government docs on here I just don’t want someone to be able to rip out the HDD and have easy access to everything.

  • unhinge@programming.dev
    link
    fedilink
    arrow-up
    0
    ·
    7 months ago

    Assuming you want:

    1. Single password prompt instead of auto-decrypt with tpm
    2. User’s files to be encrypted

    There are several ways to achieve this:

    1. autologin (recommended for single user system): / is encrypted using luks or zfs native encryption and user’s home needs to be unencrypted. User’s password may be same as encryption password for convenience, though they still are two passwords used for different purposes.

    2. pam mount: / is unencrypted or auto-decrypted and user’s home is encrypted independently from / using zfs,luks,fscrypt,etc. In this case, user’s login password must be same as user’s home encryption password. It’s suitable for multi-user system. NOTE: It cannot be used with autologin since user’s home needs to be decrypted to log in.

    WARNING: For tpm usage, using secure boot is highly recommended to prevent unauthorized user from accessing key stored in tpm.

    To prevent auto-decrypt with tpm, tpm-pin can be used (with autologin for requirement #1).

    1. systemd-cryptenroll with/without tpm: As far as I know it can be only used to unlock disk encrypted with luks2. It can be used without tpm with pkcs11-token (e.g. YubiKey) or fido2-device. It also uses parameter encryption while key is unsealed, so safe from key sniffing via communication bus. This is easy if secure boot is enabled and luks2 is used for encryption.

    2. clevis with tpm: It can be used in place of systemd-cryptenroll. May be used with zfs native encryption. Though I’m not sure if it uses parameter encryption (correct me).

    3. unencrypted keyfile on usb: Not sure about zfs, but you can use keyfile on a usb drive to decrypt luks containers.


    NOTE: I’m not a forensic/security expert. I listed a brief overview of methods I could think of to keep user’s files encrypted while providing single password till login.

    • Jediwan@lemy.lolOP
      link
      fedilink
      arrow-up
      0
      ·
      7 months ago

      Auto decrypt with TPM sounds fine to me but I have no idea what TPM is as this is my first PC with it.

      Thanks for the great response though I’ll look into these

      • unhinge@programming.dev
        link
        fedilink
        arrow-up
        0
        ·
        edit-2
        7 months ago

        I have no idea what TPM is

        Read Skull giver’s reply or look it up.


        Re-reading your post, I take you want to avoid typing long and tedious password? And that’s why you want to auto-decrypt?

        1. (Recommended) You could use strong memorable passwords that are not difficult to type and enable autologin. Related xfcd comic:

        1. systemd-cryptenroll: For TPM usage, I highly recommend using secure boot. Though not sure if you can easily do that. A less secure alternative using systemd-cryptenroll would be use tpm2-pin and bind key to no pcrs (discouraged). But then you’ll have to use luks2 for encryption. Notice from man systemd-cryptenroll regarding tpm2-pin:

        Note that incorrect PIN entry when unlocking increments the TPM dictionary attack lockout mechanism, and may lock out users for a prolonged time, depending on its configuration. The lockout mechanism is a global property of the TPM, systemd-cryptenroll does not control or configure the lockout mechanism. You may use tpm2-tss tools to inspect or configure the dictionary attack lockout, with tpm2_getcap(1) and tpm2_dictionarylockout(1) commands, respectively Also tpm2-pin is not disk encryption password and short alphanumeric password needed so tpm decrypts the device; so encryption password should be secured in a safe place. Also check if your distro supports systemd-cryptenroll.

        1. usb drive: read previous comment

        2. clevis: It probably isn’t as simple as systemd-cryptenroll but I guess you can use zfs and combine that with tpm2-pin if not using secure boot (discouraged).


        You’ll have to make a compromise somewhere between security and convenience. Even if you use pam mount, you’ll have to enter the password, biometrics won’t do.


        Edit: remove unnecessary user tag and add img uri

  • BCsven@lemmy.ca
    link
    fedilink
    arrow-up
    0
    ·
    7 months ago

    I’m not familiar with zfs, but on an encrypred drive I got around this using crypt tab If i recall. you edit a crypt file, ftab points to it or something…sorry it was 7 years ago. But there is a way to make the OS grab the decryption password. You trade convienience for security obviously

  • go $fsck yourself@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    7 months ago

    EDIT: Based on the responses I have to assume some of you guys live in windowless underground bunkers sealed off with concrete. Normal people don’t need perfect encryption they just want to add an extra hurdle or two for the crackhead who steals the PC. I assumed Linux had a system similar to what Windows or MacOS has been doing for a decade but I am apparently wrong.

    I am sorry you were treated like this and downvoted for just asking for help without being a jerk at all.

  • Pika@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    0
    ·
    7 months ago

    I use partial disk encryption myself using luksCrypt but without the auto unlock, your comment on the crackhead stealing it doesn’t help you in that scenario, you 1000% can tie a partition encryption or home directory encryption and have it automatically decrypt using either a USB drive or TPM but, as is with Windows and MacOS if your PC gets stolen, the drive will be unlocked automatically regardless if it is you, it’s only if the drive gets stolen on it’s own that an auto unlock drive would help you, but it’s not likely that only that will happen. At that point it might not be worth encrypting as a whole if that was your main concern.

    • toastal@lemmy.ml
      link
      fedilink
      arrow-up
      0
      ·
      edit-2
      7 months ago

      My previous laptop got struck by lightning last month. Because I had a passphrase & not TPM for unlocking, I stripped the NVMe from the board, put it in an enclosure, entered the passphrase, & now I can access all my data for recovering from that situation. Had I tied it ta TPM, I wouldn’t be able to recover my data (ZFS & Bcachefs only have one ‘slot’ for passphrases so no secondary, backup key)—while, as you pointed out, a thief can just boot the laptop they stole to get the data. Point being: passphrases offer advantages while being dead simple.

      • kugmo@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        0
        ·
        7 months ago

        shame it got struck by lightning, in another world you would’ve won the lottery with those chances

  • Bisexual_Cookie [comrade/them, any]@hexbear.net
    link
    fedilink
    English
    arrow-up
    0
    ·
    edit-2
    7 months ago

    as others have pointed out, you can use systemd-cryptenroll to add your tpm as a way to unlock the disk at boot, security of this should be fine if secureboot is enabled (for this to work it will need to be anyway) and a password is set for the uefi. See the archwiki entry for setup info (command is as simple as systemd-cryptenroll --tpm2-device=auto /dev/rootdrive, also the device needs to be encrypted with luks2, no idea if zorin uses that by default but you can convert luks1 to luks2 {backup ur headers first!})

  • Skull giver@popplesburger.hilciferous.nl
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    7 months ago

    You can configure Linux to automatically log you in after decrypting the disk. You can also configure Linux to automatically unlock the disk through a TPM.

    I have no idea how to do it on Zorin, though. There are guides online about how to do it, but they’re not written for Zorin’s target audience (Linux beginners, mostly).

    I think you’re right that this stuff should be easier. However, Linux lacks proper integration between the biometrics system and the TPM that Windows and MacOS have, so what you want is technically very difficult at the moment. Unfortunately, the phobia many Linux people have for technologies like TPMs will probably make it take a while before such features will be available.

  • umami_wasabi@lemmy.ml
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    7 months ago

    If you want some more convenience but don’t want to give up security, you can use hardware tokens like Nitrokey with GPG.

    The process would be generate a random file using dd and /dev/urandom. Set this as the key for FDE. Encrypt it using your GPG and store it on /boot. Have a helper script to ask you plugin your Nitrokey and (optional) pin to decrypt the keyfile to have root decrypted. I had read this on some blog for dm-crypt so you will need to research and adopt to your setup.

  • carzian@lemmy.ml
    link
    fedilink
    arrow-up
    0
    ·
    7 months ago

    It’s disappointing to see so many commentors arguing against you wanting to do this. Windows has it through bitlocker which is secured via the TPM as you know. Yes it can be bypassed, but it’s all about your threat level and effort into mitigating it.

    I am currently using a TPM on my opensuse tumbleweed machine to auto unencrypt my drive during boot. What you want to do is possible, but not widely supported (yet). Unfortunately, the best I can do is point you to the section in the opensuse wiki that worked for me.

    https://en.opensuse.org/SDB:Encrypted_root_file_system

    If you scroll down on that page you’ll see the section about TPM support. I don’t know how well it will play with your OS. As always, back up all your files before messing with hard drive encryption. Best of luck!

    • go $fsck yourself@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      7 months ago

      Yeah, holy shit is this comment section toxic. Why are people downvoting for someone asking for help and not being a dick?

      Is this whole community like this? Are the mods okay with this behavior?

    • MangoPenguin@lemmy.blahaj.zone
      link
      fedilink
      English
      arrow-up
      0
      ·
      7 months ago

      Sums up about every thread asking how to do something on Linux, 30 different responses on how the OP is wrong and shouldn’t do it that way.

      • PainInTheAES@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        7 months ago

        To be fair there are probably many different ways to solve the problem. I’m somewhat experienced with Linux and I’ve attempted seeing up TPM LUKS decryption on boot. It’s certainly not easy or at least wasn’t when I tried. For non experienced people it’s easier to just enter the password at boot and enable auto login. Then you get the security, software, ethics, or licensing debates that accompany most Linux discussions.

        • rufus@discuss.tchncs.de
          link
          fedilink
          arrow-up
          0
          ·
          7 months ago

          I mean it’s somewhat of a meme. But XY-Problems are super common. I also sometimes learned something new and that my approach wasn’t the best and I’m kinda experienced with Linux. It’s usually more the annoying and stupid people who don’t want to explain what they’re trying to achieve even if asked and insist on going with the path they’ve chosen without listening to advice… On the other hand it’s a balance. There are also nerds without social skills that don’t explain things well. But in my experience it’s frequently XY-Problems and the people asking for advice not listening.

    • Jediwan@lemy.lolOP
      link
      fedilink
      arrow-up
      0
      ·
      7 months ago

      Thanks, Zorin is based on Ubuntu so I have to assume it will be up to date with stuff like TPM. The data on the page you linked is pretty advanced for me but I’ll give it a shot. Appreciate you addressing my question.

      • carzian@lemmy.ml
        link
        fedilink
        arrow-up
        0
        ·
        7 months ago

        Ubuntu isn’t really on the cutting edge, so I’m not sure how well its going to work. Opensuse tumbleweed is running pretty much the latest everything, so its possible youll need to wait until the next Ubuntu lts

  • hperrin@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    7 months ago

    If it’s LUKS encryption, yeah, you can unlock it with the TPM. I forget how. Basically you add another key to LUKS that comes from the TPM. There are guides online.