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.

  • go $fsck yourself@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    1 year 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.

  • Ptsf@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    1 year ago

    OP, just change your encryption key to whatever you have your password as and set your login to auto login. This will give you the experience you desire as it’ll decrypt the disk with your password and log you in automatically once it’s decrypted, but if you lock the system (close the lid. Screen lock. Etc) you’ll still get a login screen as normal. (Just keep in mind they’re technically two separate passwords and will unfortunately need to be changed separately if you do change your password).

    • TDCN@feddit.dk
      link
      fedilink
      arrow-up
      0
      ·
      1 year ago

      What I do for a little extra security is that my encryption password is just a longer variation of my normal password. So of I have an encrypted password sentence like “correct battery staple horse” my login password would just be “correct battery”. It’s a simple way to add a little extra and a good reminder everytime I turn on my computer that they are in fact two different passwords and protect me differently.

  • bad_news@lemmy.billiam.net
    link
    fedilink
    arrow-up
    0
    ·
    1 year ago

    My mom brings me and my anime mousepad with boobs waifu bagel bites, what does your mom even do? Also, you can do autologin, so you only enter a password once to decrypt on boot.

  • Pierre@beehaw.org
    link
    fedilink
    arrow-up
    0
    ·
    1 year ago

    I do not know the answer, but this got me thinking: would it be easier to set up a single login for both session and decryption if /home was on a separate partition and only /home was encrypted?

  • unhinge@programming.dev
    link
    fedilink
    arrow-up
    0
    ·
    1 year 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
      ·
      1 year 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
        1 year 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

  • wispydust@sh.itjust.works
    link
    fedilink
    arrow-up
    0
    ·
    1 year ago

    This reply isn’t going to be helpful to OP, but thought I might add context for others passing by.

    I’m using Arch Linux with LUKS encryption and gdm. As long as my user’s password is the same as the LUKS password, I only ever type my password in once.

    Just saying that a MacOS-like convenience is definitely possible on Linux.

    • Jediwan@lemy.lolOP
      link
      fedilink
      arrow-up
      0
      ·
      1 year ago

      Fascinating, you don’t have automatic login enabled? And I assume this is at the pre-login prompt?

        • unhinge@programming.dev
          link
          fedilink
          arrow-up
          0
          ·
          1 year ago

          user’s password can be totally different from luks password if you’re using autologin. You can keep it same but that’s totally optional. You can login without entering any password at all if not using luks (or using autodecrypt), you can see that in live isos.

  • GolfNovemberUniform@lemmy.ml
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    1 year ago

    Afaik you can’t. Disk encryption requires entering the password every time and it asks for it BEFORE the OS is started so you can’t use biometric login either

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

      That’s not technically true as enabling bitlocker on windows and filevault on Mac don’t require two different passwords.

      • GolfNovemberUniform@lemmy.ml
        link
        fedilink
        arrow-up
        0
        ·
        1 year ago

        Sorry idk much about Windows and Mac. But what you said sounds like their encryption systems aren’t full disk encryption, they somehow found a way to store the password for login or they just disable the login password completely when the encryption is enabled

      • Lodra@programming.dev
        link
        fedilink
        English
        arrow-up
        0
        ·
        1 year ago

        I recently dug into this because I accidentally trashed my wife’s OS which was encrypted with bitlocker. PITA btw and I couldn’t beat the encryption

        Bitlocker encryption key hash is stored in 2 possible places. First is an unencrypted segment of the encrypted drive. This is bad because it’s pretty easy to read that hash and then decrypt the drive. The second place is on a Trusted Platform Module (TPM) which is a chip on the motherboard. This is better because it’s much more difficult to hack. It can be done but requires soldering on extra hardware to sniff the hash while the machine boots up. Might even be destructive… I’m not sure.

        Either way a motivated attacker can decrypt the drive if they have physical access. For my personal machines, I wouldn’t care about this level of scrutiny at all.

        Anyways you can see if any open source solutions support TPM.

      • visc@lemmy.world
        link
        fedilink
        English
        arrow-up
        0
        ·
        1 year ago

        Mac will ask you to “log in” very early in the boot process to decrypt the disk, I assume it keeps the drive key encrypted with your password somewhere.

        • Jediwan@lemy.lolOP
          link
          fedilink
          arrow-up
          0
          ·
          1 year ago

          That’s just not true I have two macs with it enabled on both and it requires a single “normal” password

          • visc@lemmy.world
            link
            fedilink
            English
            arrow-up
            0
            ·
            1 year ago

            Yes normal password but it happens super early on mine, and once you log in there is a boot progress bar afterwards. This is an Intel Mac, might be different on apple chips.

          • GlitzyArmrest@lemmy.world
            link
            fedilink
            English
            arrow-up
            0
            ·
            1 year ago

            That’s likely because your Macs are using the TPM. Does your Linux machine have a TPM, and are you using it?

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

              I don’t think so, they are both intel macs over 10 years old and Macs didn’t start adding TPM until 2017. On Mac, when you check the box to encrypt the drive during install you’re prompted for an encryption password which you never need to use again unless you remove the drive and put it into another mac (or in my case add a second hard drive and use the original as “extra” storage).

  • init@lemmy.ml
    link
    fedilink
    arrow-up
    0
    ·
    1 year ago

    If you want to do away with any protection you have with opting in to a security measure, like typing in a password, why don’t you just reinstall and not select the encryption option?

    Not requiring a password, or automatically entering a password to decrypt the filesystem, is essentially the same as not having encryption.

    Decide which you want: Security or convenience. You cannot have both.

  • Random Dent@lemmy.ml
    link
    fedilink
    English
    arrow-up
    0
    ·
    1 year ago

    Not sure if this works with drive encryption since it comes before the OS, but could this maybe be done with a YubiKey or something like that?

    That way, you can plug it in and not worry about typing the password every time, but then it’s also secure if someone takes your PC? As long as you remove the key when it’s off of course.

    • Bitrot@lemmy.sdf.org
      link
      fedilink
      English
      arrow-up
      0
      ·
      1 year ago

      Yes, systemd-cryptenroll supports Yubikey as well as generic FIDO2 tokens (and the TPM on most distros).

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

      Encryption makes it more difficult to copy data from the drive. Windows and MacOS can manage to encrypt drives without requiring two different passwords, I mistakenly assumed Linux could too.

      • kebabslob@lemmy.blahaj.zone
        link
        fedilink
        arrow-up
        0
        ·
        1 year ago

        How… How would they get the drive? Would n that need access to your computer? I imagine at that point they could turn it on first and copy your data that way, no?

      • Confused_Emus@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        1 year ago

        But if you have it set to unlock automatically…? It’s not like the drive is going to know it’s you booting it vs someone else if you’re not having to enter the password.

        Windows and Mac can indeed encrypt drives without two passwords - as long as you don’t set a drive encryption password to be entered at BIOS load before the OS loads, which is what you’ve done.

        • Jediwan@lemy.lolOP
          link
          fedilink
          arrow-up
          0
          ·
          1 year ago

          as long as you don’t set a drive encryption password to be entered at BIOS load before the OS loads, which is what you’ve done.

          MacOS does ask for a different password during setup, which you never have to use again unless you want to access the drive on a different PC.

        • Markaos@lemmy.one
          link
          fedilink
          arrow-up
          0
          ·
          1 year ago

          The idea is to use TPM to store the keys - if you boot into a modified OS, TPM won’t give you the same key so automatic unlock will fail. And protection against somebody just booting the original system and copying data off it is provided by the system login screen.

          Voilà, automatic drive decryption with fingerprint unlock to log into the OS. That’s what Windows does anyway.

          • Jediwan@lemy.lolOP
            link
            fedilink
            arrow-up
            0
            ·
            1 year ago

            I don’t suppose you know of a tutorial to get this set up? Google turned up nothing.

          • Confused_Emus@lemmy.world
            link
            fedilink
            arrow-up
            0
            ·
            1 year ago

            I see. I don’t know that the usual drive encryption you set up during Linux install works with that, but there are BitLocker-like programs for Linux that might.

          • Confused_Emus@lemmy.world
            link
            fedilink
            arrow-up
            0
            ·
            1 year ago

            Although OPs scenario is if someone steals the tower, in which case it’s not a different TPM. Would only help if the drives were yanked, which honestly I’d probably do rather than try to take the whole tower.

            • Markaos@lemmy.one
              link
              fedilink
              arrow-up
              0
              ·
              1 year ago

              If you boot the computer into the currently installed OS, you will be presented with a login screen and will have to enter the correct password to log in (kernel parameters are part of the checksums, so booting into single-user mode won’t help you, that counts as a modified OS). If you boot a different OS, you won’t get the key off the TPM.

      • GlitzyArmrest@lemmy.world
        link
        fedilink
        English
        arrow-up
        0
        ·
        1 year ago

        If you’re having it automatically unlock the drive at boot, it kind of defeats the purpose. If someone steals your tower, they can boot it and copy the unencrypted contents since it automatically unlocks.

        • fuckwit_mcbumcrumble@lemmy.world
          link
          fedilink
          English
          arrow-up
          0
          ·
          1 year ago

          OP isn’t asking for it to decrypt automatically. OP is asking for the entering the decryption password to also log you in. That way you only have to type the password once, instead of twice.

        • phx@lemmy.ca
          link
          fedilink
          arrow-up
          0
          ·
          1 year ago

          It depends on where the encryption data is stored. If the bootloader and bios/efi are locked down and the data to unlock is stored in an encrypted enclave or one is using a TPM (and not an external chip one that can be sniffed with a pi), that’s a reasonable protection for the OS even if somebody gains physical access.

          You could also store the password in the EFI, or on a USB stick etc. It doesn’t help you much against longer-term physical access but it can help if somebody just grabs the drive. It’s also useful to protect the drive if it’s being disposed of as the crypto is tied to other hardware.

          Even just encrypting the main OS with the keys in the boot/initrd has benefit, as ensuring that part is well-wiped makes asset disposal safe®. Some motherboards have an on-board SDCard or USB slot which your can use for the boot partition. It means I don’t have to take a drill to my drives before I dispose of them

        • catloaf@lemm.ee
          link
          fedilink
          English
          arrow-up
          0
          ·
          1 year ago

          How would they be able to copy the unencrypted contents? They still can’t do anything without logging in.

            • Ptsf@lemmy.world
              link
              fedilink
              arrow-up
              0
              ·
              1 year ago

              Perfect security doesn’t exist. If they’ve got the engineering capital required to design and manufacture key retrieval hardware, you lost the moment they gained physical access to your equipment.

              • catloaf@lemm.ee
                link
                fedilink
                English
                arrow-up
                0
                ·
                1 year ago

                If they have the capability to extract the key, they probably also have the computational resources to brute-force the passphrase. It’s not a meaningful difference.

                • Ptsf@lemmy.world
                  link
                  fedilink
                  arrow-up
                  0
                  ·
                  1 year ago

                  Most brute-force attacks can be hardened against. Again there’s no perfect security, just better security.

              • TDCN@feddit.dk
                link
                fedilink
                arrow-up
                0
                ·
                edit-2
                1 year ago

                I agree. Physical access to the device and its often game over.

                Sadly reading off the key is already trivial in some cases as showcased in this recent video by stacksmashing

                Since the key has to be sent to the cpu in plain text it can easily be sniffed. If however the TPM is integrated in the cpu its not so easy, but then the os can be manipulated or hacked after boot with known exploits.

                If you have a long and secure password for you encryption the absolute only way in is to brute force the key which is significantly harder if not impossible regardless of capital

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

                If he uses TPM. I’m not aginst OP using it but he needs to understand the drawbacks. At least I hope he will.

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

              At least on Windows that requires booting the PC from some other media, and that wouldn’t work with the drive encrypted because you have no access to the files you need to modify.

              Is it similar with Linux, or do you mean you can actually bypass login from the OS that’s already booted up??

            • Markaos@lemmy.one
              link
              fedilink
              arrow-up
              0
              ·
              edit-2
              1 year ago

              Yeah, but a lot of those things will trip the TPM module, so you will get a different decryption key if you for example try to use the single kernel parameter to boot into a root shell. And different decryption key means no access to the data.

  • Bitrot@lemmy.sdf.org
    link
    fedilink
    English
    arrow-up
    0
    ·
    edit-2
    1 year 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

  • Saff@lemmy.ml
    link
    fedilink
    arrow-up
    0
    ·
    1 year ago

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

  • BCsven@lemmy.ca
    link
    fedilink
    arrow-up
    0
    ·
    1 year 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

  • SethranKada@lemmy.ca
    link
    fedilink
    English
    arrow-up
    0
    ·
    1 year 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
      1 year 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
      ·
      1 year 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
        ·
        1 year 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.