I'm using encrypted home directories, and in my day to day activities, I have two user accounts I switch between, one for personal stuff, one for work stuff. However, it's fairly common that I need to access personal files for work stuff, or vice versa.

So, how can I set up automatically mounting the other directory at login? I use the same password for both, so the system should be able to access to the encryption keys at login time. I've done a bit of googling, and I can't even figure out where the config files for this are...


Steps to decrypt a user folder can be found in this discussion thread:


Once you have the encryption key for the second directory in your keyring, you could execute this on login:

sudo mount -t ecryptfs /home/user/.Private /home/user/Private

and the second directory would be available at /home/user/Private


i believe the encrypted home is unlocked with your login password but only through the gnome-keyring the actual password for the home folder is a rather long randomly generated password

i've never done it but it should be able to unlock it using this long password and save that to your keyring this command will get you the long passphrase

ecryptfs-unwrap-passphrase ~/.ecryptfs/wrapped-passphrase

you will have to do this logged in as the other user

then this should add it to your keyring


do this logged in as the other user taking not of the unwrapped passphrase in the first command

i've never done any of this so it would be a good idea to have a look over the man pages first

also make a note of both of the wrapped passphrase aswell just incase when you add it to the keyring it removes your passphrase not sure if it will store 2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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