I use a usb thumb drive with several partitions in order to share my personal data among machines. Each partition is (bitlocker) encrypted. I am looking for a solution to automatically unlock and mount the partitions at some dedicated location. This is what I tried so far:
-
Using a script collecting cryptsetup and mount commands, which is properly protected from unauthorized inspection and has NOPASSWD privileges would provide a one-click-solution for the job. This to my understanding not receommended, due to security reasons.
-
Using
/etc/cryptsetupentries in combination with/etc/fstabentries would also do the job:
mobi_usb PARTUUID=47119ece-19e8-423c-add4-20af5e57f527 /etc/cryptsetup-keys.d/mobi-bitlocker.key bitlk,nofail
/dev/mapper/mobi_usb /mnt/org/mobi auto users,nosuid,nodev,nofail,x-systemd.automount 0 0
But I encounter problems, when trying to unmount the partitions, e.g. in dolphin (it would not let me do so!).
- Using the KDE Plasma settings
System Settings > Removable Mediawould let me configure in order to have the encrypted volume opened on attach and then using the fstab entry above to mount it at the dedicated location. In this case, I am however prompted for confirmation of the password which was extracted successfully from kwallet.
In summary, I encounter either security, stability or a usability issue.
What is the correct approach to achieve my goal (i.e. attach the usb and magically have all encrypted partitions at the correct locations being opened with no further password/passphrase/click interaction)?
Thanks!