Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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'm looking into encrypting my home folder with Truecrypt, and mounting it after I've logged in, which should be pretty straightforward. However, it occurred to me that it should be theoretically possible to mount it as I'm logging in, as long as my account password is the same as my Truecrypt password. Is there a way to get PAM to run a command on login and pass the command my password as an argument? Or is there some other way to accomplish the same effect, without me needing to provide the password multiple times?

share|improve this question
See pam-mount.sourceforge.net. I know it can pass passwords to dm-crypt+luks, not sure about Truecrypt though. – Zoredache Jan 18 '11 at 20:42
Pam_mount can pass passwords to many file or disk encryption methods supported by Linux (dm-crypt, encfs, …), but note truecrypt. – Gilles Jan 18 '11 at 20:56
you could do something like this: outlyer.net/howtos-linux/pam_mount-encfs note: I'm not saying use encfs. It's a way to get a script to be run by pam_mount – RobotHumans Jan 28 '11 at 11:08

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.