I have an encrypted home dir, which is automatically decrypted upon login. (Linux, if you were in doubt). I want to mount a large truecrypt partition automatically when i log in.
![]()
I wrote a small script that mounts the truecrypt drive. I added to .bashrc (you could also use .profile i guess) that this script automount script is mounted upon login.
Heres the initial script
truecrypt -t -k "" --auto-mount=devices -p 'MySuperSecretPassword'
Storing the password inside the script isnt the problem (remember that homedir is already encrypted). The problem is, when doing “ps ax”, the password shows up in the list, as such:
3471 ? Ssl 0:00 truecrypt -t -k --auto-mount=devices -p MySuperSecretPassword
Bad idea.. I want to mount using a password and not a “keyfile”, but truecrypt doesn’t provide any other way of supplying a password.
However the solution was pretty simple, once i found it.
echo "MySuperSecretPassword" | truecrypt -t -k "" --auto-mount=devices -p ''
Its really a coincidence that this works. Truecrypt tries to mount using a blank password.. Once this fails, it will prompt for a password.. The prompt will be filled from the pipe.. And now password is gone from ps ax and im a happy camper.
- Dan
