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

When I login on my Ubuntu system a script will mount a truecrypt container. To decrypt the container I have of course to enter the decryption password. But Truecrypt also asks for my "administrator password". Why does Truecrypt ask for my administrator password and how can I disable this?

This is the script which runs on startup:

#!/bin/sh -e
/usr/bin/truecrypt /media/windows/ /media/data
/usr/bin/dropbox start

/media/windows is a NTFS partition. /media/data is writable by the user.

share|improve this question
Wouldn't it be easier just to put your user in the (fuse?) group, to allow mounting filesystems without superuser privilege? Mounting doesn't need root, but root has all privileges (including mount)... (At least that was the case in earlier Linux versions) – Dexter Jul 8 '13 at 18:26
up vote 7 down vote accepted

TrueCrypt asks you for a password because mounting a filesystem requires superuser privileges. Do not circumvent it by allowing to run truecrypt as root without password, this is insecure as a malicious script can get elevated privileges by mounting a special-crafted container, and gain root privileges from it (e.g. setsuid binaries on in an ext2 filesystem or mounting on /).

share|improve this answer
Thanks for the answer. When I have enough rep, I will upvote. – i.amniels Oct 17 '11 at 21:52
Not anyone can mount if his username is declared on visudo, only him will be able to use it without sudo password. – Bruno Pereira Oct 17 '11 at 21:56
@brunopereira81: that's true, but it's still a security risk. I've updated the answer. – Lekensteyn Oct 17 '11 at 22:01
sounds great ;) – Bruno Pereira Oct 17 '11 at 22:05

Here is a quick fix you can use:

sudo visudo 

Add the line <yourusername> ALL=NOPASSWD: /usr/bin/truecrypt and save the file. truecrypt wont ask for your admin password anymore for . It quick and dirty, probably not safe, but works.

share|improve this answer
Thanks for the answer. When I have enough rep, I will upvote. – i.amniels Oct 17 '11 at 21:52
If it works im happy enough. gl and if needed ask ;) – Bruno Pereira Oct 17 '11 at 21:53
Note that the directive must be placed at the end of the config, otherwise it might be overridden by other directives, e.g. by %sudo ALL=(ALL:ALL) ALL and it won't work. It cost me a bit of time to figure this out. – tmTM Jan 7 '14 at 9:56

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.