Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Unlock LUKS with login/password

User discussion about Debian Development, Debian Project News and Announcements. Not for support questions.
Post Reply
Message
Author
paratrap
Posts: 47
Joined: 2010-09-05 13:08

Unlock LUKS with login/password

#1 Post by paratrap »

Hello!

I have an idea about how modern linux works with encrypted LUKS partitions.

Right now on system encrypted with LUKS first prompt you see is a grub passphrase to unlock the device and after OS boot you see second prompt for login/password. This looks redundant.

What if we can by pass second prompt and allow grub to handle login/password prompt? It can be done with few steps:

1) grub can ask for login/password, then MD5 the text and unlock LUKS device using this MD5 passphrase. md5(login+password) or plain(login+password)

2) grub passing the login/password to the kernel.

3) Kernel boots and passing (or password manager service, like systemd) read that data from kernel (/proc/cmdline) and rewrites it (hide from cmdline).

4) password manager (systemd service) makes auto login with provided data

5) if user updates the password, then password manager updates LUKS corresponding slot with md5(login+password) or plain(login+password)

Since LUKS1 support for 8 keys, we can support only 8 logins which can open and automatically login. Password manager has to associate every user (UID) with LUKS device UUID and slot number for simply key updates. Or even using one SLOT0 but different technique for encrypting keys (the only limitation here we can't change slot0 passphrase, since it would require to update all user passwords). Also possible to use LUKS masterkey and keep all users logins (LUKS masterkey encypted with login/password) at ESP partition or stage2 image for grub to check.

This is major changes to the linux password management. Can it be improved and proposed as standard?
Last edited by paratrap on 2023-03-05 11:39, edited 3 times in total.

itmicp
Posts: 38
Joined: 2013-05-11 04:45
Location: France
Has thanked: 6 times
Been thanked: 6 times

Re: LUKS login/password

#2 Post by itmicp »

Hi

I don't know what desktop environment and display manager you are using,
but you can probably just enable autologin.

For example, with lightdm : wiki.debian.org -> lightdm : Enable autologin

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: LUKS login/password

#3 Post by p.H »

paratrap wrote: 2023-03-03 14:16 Right now on system encrypted with LUKS first prompt you see is a grub passphrase to unlock the device
In a default Debian installation, the passphrase is prompted by the initramfs, not GRUB.

lindi
Debian Developer
Debian Developer
Posts: 452
Joined: 2022-07-12 14:10
Has thanked: 1 time
Been thanked: 88 times

Re: LUKS login/password

#4 Post by lindi »

Are you thinking about single-user systems here? Autologin is probably one option here but note that it cannot unlock your keyring so you will anyway need to enter the password to use that at some point. If you have multiple users and you need to isolate them from each other you need to ensure that they cannot get root access. One way to accomplish this is to use the TPM to hold the LUKS secrets.

paratrap
Posts: 47
Joined: 2010-09-05 13:08

Re: LUKS login/password

#5 Post by paratrap »

1) I'm not talking about autologin feature. I'm talking about unlocking HDD using login / password

2) I'm using ESP + SINGLE LUKS partition scheme. first grub asks for passphrase, then initrd reads passphrase from /boot/luks-key file and auto unlock the partition. Them gdm asks for login/password

3) autologin CAN unlock since the idea I'm proposing passing login and password to the session manager which can unlock keyring.

Guys this is a idea / proposal about unlocking LUKS using login / password instead passphrase.
Last edited by paratrap on 2023-03-06 09:12, edited 1 time in total.

lindi
Debian Developer
Debian Developer
Posts: 452
Joined: 2022-07-12 14:10
Has thanked: 1 time
Been thanked: 88 times

Re: Unlock LUKS with login/password

#6 Post by lindi »

Ok so mostly about speeding up login? Do you want to support multiple users that cannot access files of each other or is a single user enough?

paratrap
Posts: 47
Joined: 2010-09-05 13:08

Re: Unlock LUKS with login/password

#7 Post by paratrap »

Mostly about having one login/password pair to unlock a device, not having two passphrase + login/password. This is about single LUKS partition (ESP+LUKS(boot,home) with multiply users.

lindi
Debian Developer
Debian Developer
Posts: 452
Joined: 2022-07-12 14:10
Has thanked: 1 time
Been thanked: 88 times

Re: Unlock LUKS with login/password

#8 Post by lindi »

How can you use LUKS with multiple users? Any user could just boot a livecd and look at the files of other users since they can open the LUKS container?

paratrap
Posts: 47
Joined: 2010-09-05 13:08

Re: Unlock LUKS with login/password

#9 Post by paratrap »

With people who trust each other. Multiuser accounts only for separation of personal data, browser history, etc, not for security

Post Reply