0

I hope my message is posted in the right section, i'll try being as precise as i can.

i'm running:

  • arch-linux with LTS kernel (4.19.52-1-lts)
  • zfs on root (0.8.1).
  • systemd: 242 (242.29-1-arch)
  • lightdm (1:1.28.0-4)

i have set-up my home users as encrypted zfs vdev. what i would like to achieve is :

  • as a user login into their lightdm session (first login)
  • the systemd-service use the given password to unlock and mount the vdev.
  • the rest of the session continues normally
  • upon closing the last session, systemd call the Execstop that unmount and closes the vdev.

i've tried creating a home.service file like so:

[Unit]
Description=home user's access

[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=zfs mount -l rpool/OS/home/%h
ExecStop=zfs umount rpool/OS/home/%h && zfs unload-key rpool/OS/home/%h
TiemoutStartSec=0

[install]
WantedBy=default.target

now to the statement:

  • i have no idea how could i get the user's password
    • even better: i don't think that's the right way to proceed for such an action (mounting an encrypted fs as a home user's directory using the login password)
  • i tried to find information on [systemd] [service] [login] [password]
    • nothing provided information on getting the password, only variables
      • i'm definitely not against it, but how could i get the user's password's variable.
    • they most certainly do not take into account zfs encryption
  • i am not blind to the lack of knowledge i have of systemd.

so, no, i am not expecting the answer on a silver plate, that would get me nowhere. what i would like is :

  • is this the correct way to implement such a task ?
  • could you provide me with documentation / tips on how to get the users' systemd-session's password properly / not in an ugly way / kind of secure way (as could be)

thank you in advance.

  • Hi again, Nobody can help me with this ? not even a bit ? thanks – Dboy Jul 8 '19 at 7:55

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.