The file can be mounted manually via 'cryptsetup luksOpen' and 'mount /dev/mapper' but I would like it to be mounted automatically while logging in and by showing a GUI dialog for the passphrase just like gnome/nautilus/ubuntu (?) is doing when an encrypted mass storage USB device is connected.

The (loopback) file containing the encrypted file system, is stored in a user's non-encrypted home directory.


if you have cryptsetup, configure your /etc/crypttab:

#<target name><source device><key file><options>
dm-2    UUID=XXXX  arg  luks,keyscript=/root/script.sh,noearly

cryptsetup will execute /root/script.sh arg and all it gives on output takes as passphrase to unlock devices.


Gnome has a 'startup applications' program. If you are using Unity you should just be able to access it with <Super> start <ENTER>. From here enter the command that makes the prompt pop up. Unfortunately I wasn't quite sure what you are referring to, so I can't tell you how to do that. Another method is contained on the ubuntu wiki for FolderEncryption

  • The GUI dialog looks like this: link It is automatically displayed when a LUKS encrypted USB mass storage device is connected, but I don't know how. Based on some googling I suspect that Nautilus is involved somehow.
    – Ulrik
    Feb 12 '13 at 20:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.