Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Ubuntu offers the ability to automatically mount/unmount the home directory using encFS when the user logs in or out.

How can this be applied to a truecrypt volume using only a keyfile (no password) residing in the home directory? The home directory must be decrypted first on login so that the keyfile is readable and then the truecrypt volume (/dev/sdb) should be mounted. The reverse occurs on logout where the volume should be dismounted (though order is less relevant).

The user in question has sudo powers but the mount should be automatic without password prompt (which permissions need to be set in order to avoid interactive sudo? Should an entry be made in /etc/fstab?)

share|improve this question

You can use a simple bash script to do so. Try truecrypt --help for the right commands. Basically it should be something like truecypt --quiet -k /path/to/keyfile /path/to/container /path/to/mountpoint

Something similiar is possible for unmounting. Now you just have to execute the bash scripts at logon / logoff, google should help here.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .