Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

I have TrueCrypt setup to mount volumes when I log into my work account. However, when I log out and log in to another account, those volumes are still mounted and available on the other account.

  1. How can I set access to those volumes? I don't want all users to be able to access them once they're mounted. (They mounted at /media/volumename - do I just set permissions on the folder "volumename" before mounting?)

  2. How can I tell TrueCrypt to dismount them when I log out?

share|improve this question
Not very well experienced with TrueCrypt, but by default the folder volumename would be accessible by world. chmod o-x volumename would revoke access. However, that should probably stop you from reading it too =) You would need to change ownership too, chown d3vid:d3vid volumename. Still, not sure if it would do what you want. If you need help resetting those changes, just ask. – Johanna Larsson Mar 25 '11 at 9:56

First, I think you have to only modify the folder's rights and make yourself the owner, so other's cannot see the it.

As for the dismount problem, you can create scripts that will autorun on logout. These are stored in /etc/gdm/PostSession. From the GDM reference:

When the user terminates his session, the PostSession script will be run. Operation is similar to Init and PreSession. That is, GDM will attempt to execute the script PostSession/ and if that doesn't exist PostSession/Default will be run. Again the script will be run with root priviledges, the slave daemon will block and the $USER environment variable will contain the name of the user who just logged out.

So basically you have to create a post-session script, that shall contain:

truecrypt -d

This will dismount all mounted TrueCrypt volumes.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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