Sample Header Ad - 728x90

Mount a LUKS encrypted EXT4 formated image file when mount folder is accessed (using autofs)

1 vote
1 answer
696 views
Here's what I'd like to do. Use autofs to automount an encrypted luks image file when the target directory is accessed. I've been playing with both fstab and crypttab, but to no luck. I do NOT want to use a key file to decrypt it. A password prompt window should appear when attempting to query the target mount folder /encrypted. cryptsetup should be mounting a file located at /secret/data.img which is a LUKS formatted file that once decrypted contains an ETX4 file system. That file system should then be mounted at /encrypted, but only after prompting the user for its password. Bonus question, after a period of idle(timeout) inactivity, autofs should be closing the luks volume so that further access requires reentering the key. Can this be done? Here is my current fstab and crypttab. --FSTAB-- UUID=11111111-2222-3333-4444-555555555555 /encrypted ext4 defaults,auto,x-systemd.automount,uid=1234,gid=1234,cache=no,rw 0 0 --CRYPTTAB-- trust-no-1 /secret/data.img none auto,rw There are no questions that contain both autofs and luks keywords. Is this even possible?
Asked by JDMcMillian (121 rep)
May 7, 2023, 04:10 PM
Last activity: May 8, 2023, 07:26 AM