‘TrueCrypt’ is considered as a very secure data encryption utility (a ‘front-end’ actually). It is free to use, runs on GNU/Linux, Windows and Mac OS X, comes with a lot of features (including the ability to encrypt your system or the OS partition), portable and is very easy to use.
Now, installing ‘TrueCrypt’ in GNU/Linux distributions such as Ubuntu is extremely easy. But it can be a bit troublesome in others such as Fedora (18). This is because Fedora comes with different security settings and thus (though it installs and runs smoothly), you will run into problems while trying to mount your encrypted files, as ‘TrueCrypt’ will give you an error and won’t let you mount them.
But the good news is that, this is easily fixable, so if you have been having this ‘phenomenon’ ;-), and looking for a way to get around it, then this post is for you.
First of all, let’s install it in Fedora 18.
Now go to this ‘TrueCrypt’ download page and then under ‘Linux’ select the ‘Standard -- 32-bit (x86)’ or the ‘Standard -- 64-bit (x64)’ package, and download it.
Then open the downloaded file and extract its content (there should be only a single file) to your ‘Home’ folder.
Now open your Terminal window and enter the below command.
This will give you a list of files that are on your ‘Home’ folder. Now locate the extracted file (as shown below, in this example, its ‘7.1a-setup-x64’) and copy its name.
Then enter the below command. Make sure to replace the ‘7.1a-setup-x64‘ part with the file name of your extracted ‘TrueCrypt’ setup file’s name.
su -c './truecrypt-7.1a-setup-x64'
This will start the setup wizard. On the next step, on the ‘Installation Options’, choose ‘1’ and press the Enter key to continue. Then you will be asked to accept the license & the terms etc. It is pretty simple and you should not have any issues doing those. When all is done, you’ll be asked to press the ‘Enter’ key to exit the setup.
Now you have installed ‘TrueCrypt’ on Fedora 18.
Getting around the mounting error …
In GNU/Linux, whenever a program is trying to get access to ‘sudo’ or administrative privileges, the OS first reads a file called ‘sudoers’. It uses this file as the foundation of how the ‘sudo’ privileges are granted.
But as mentioned above, due to a slight change in this file in Fedora, ‘TrueCrypt’ will be unable to mount your encrypted files, where in other distributions like Ubuntu, comes with that option disabled in the ‘sudoers’ file, and thus, one won’t run into such issues. So the easiest solution is to disable that option (it’s called ‘requiretty’) and it will fix your issue.
I have tried that and it works. But I’ll be honest here. I’m not an expert on this, therefore, perhaps there are reasons why Fedora comes with it enabled, thus, disabling it might not be a good idea. However, according to the ‘sudoers’ manual, this is what it says about the ‘requiretty’ setting …
If set, sudo will only run when the user is logged in to a real tty. When this flag is set, sudo can only be run from a login session and not via other means such as cron(8) or cgi-bin scripts. This flag is off by default.
So perhaps it is safer to disable it. Nevertheless, if you want to keep that setting as it is, and just want to mount your encrypted files, then there is another way that you can do it.
The only downside of this is that, every time you want to open ‘TrueCrypt’, you will have to open your Terminal window and execute it through that. If you are okay with that, then all you have to do is to enter the below command.
su -c 'truecrypt'
When asked, enter the admin (‘root’) password that you created while installing Fedora, and now ‘TrueCript’ will be able to mount your data without any problems :D.
Disabling the ‘requiretty’ anyway …
If you don’t like the idea of using the command-line to run ‘TrueCrypt’, then you can completely disable the ‘requiretty’ option, as it will solve your problems. Follow the below steps for that. But again, please remember that, this might decrease your overall security.
First, make sure your usual user account has administrative (also called ‘su’, ‘sudo’, ‘root’ though they have subtle differences) privileges, as it is needed for this to work.
By default, the first user account created by Fedora 18, is a non-administrator account. So, open your Terminal and enter the below command (make sure to replace ‘gayan‘ with your user account’s name).
su -c 'usermod -a -G wheel gayan'
Now reboot your computer.
Then re-login using the user account that you just made an administrator and put the below command into your Terminal for editing the ‘sudoers’ configuration file.
sudo gedit /etc/sudoers
When asked, enter that user’s password.
This will open the ‘sudoers’ configuration file using the ‘Gedit’ text editor. Now find an option called ‘Defaults requiretty’ (located around the near end) and put a ‘#’ sign at the start of that line, to disable it (shown below).
Then click on the ‘Save’ button and exit the editor.
That’s it. From now on, you should be able to open ‘TrueCrypt’ as usual (without using the Terminal window) and mount the encrypted volumes. Good luck.