I've got LUKS (Linux Unified Key Setup) running on a couple of my Linux boxes. I've looked online but haven't seen anyone document how to make it work in a single signon option, but was hoping someone could either point me in the right direction or give a definitive no that won't work (or more likely, no that won't work without writing some extra PAM etc. code).

Specifically, what I would like to do is boot up my system (which has let's assume 4 user accounts). When I get prompted for my passphrase, it unlocks LUKS and boots up, and then tries that same passphrase to log in the user that's associated with that passphrase. (LUKS supports 8 different passphrases but I'd be fine if there was just a single user supported (my primary username) and if I wanted to log in to a different account, I could log out / switch user.

Update: I'm encrypting the whole disk.

  • 2
    Sounds like you're simply looking for a way to make that user autologin (and ignore the LUKS part completely). cryptsetup doesn't really give any feedback as to which passphrase slot was being used in the unlocking. Either way you'd have to script this manually. – frostschutz Oct 25 '13 at 17:42
  • 1
    Is the entire drive encrypted, or just the home? If it's just the home you can use pam_mount for this. – Patrick Oct 26 '13 at 0:44
  • @Patrick doing whole disk encryption; I'm assuming pam_mount would work in the other order (I login, and that triggers unlocking my home directory?) – Foon Oct 26 '13 at 0:46
  • Correct. And with whole drive encryption, what frostschutz said is correct, you'll have to write a script (and it'd likely be very difficult to do securely). – Patrick Oct 26 '13 at 1:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.