Complicated situation. I have my /home directory encrypted with LUKS, and I use PAM to autotomatically decrypt it and mount it on KDE (SSDM) login. Now I want to also automount several SSHFS remote directories into several subdirectories of my (single user’s on this workstation) home folder. What I have done so far:
- I edited my pam.d with “auth optional pam_exec.so expose_authtok /etc/luks_decrypt.sh” so my credentials are passed on to “cryptsetup open /dev/md1 enc_home” etc. This decrypts the encrypted LUKS volume and works fine.
- I created a “.mount” systemd unit that “Requires=user@1000.service”. So when my user logs in:
[Mount]
Where=/home
What=/dev/mapper/enc_home
This works fine as well.
Now, AFTER this happens, I want to mount some remote directories from an SSH server to some (empty) directories of the decrypted home folder of the user. Like /home/myuser/remote_server_files_1/, /home/myuser/remote_server_files_2/, /home/myuser/remote_server_files_3/ using a shell script in my home directory.
My problem is that I’m pretty thick with systemd, and it seems that whatever I do tries to mount BEFORE the actual user home has been decrypted and mounted.
Any idea as to what I can do? I also tried KDE’s autostart but it seems it doesn’t work since Plasma 5.21 due to migrating the entire procedure to systemd as well (and I can’t find any documentation as to how it works).
Thank you!