Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 am looking for a way to mount the user's home directory after she logs in (in KDE or Gnome login manager, for example). Is it actually possible and if it is, what tools should I use to do it? It also would be good to unmount the home directory after the users logs out.


share|improve this question

The normal way for doing this (in enterprises) is automount. It may be a bit complicated for a home environment though. There should be several tutorials on the web.

Automount in general unmounts unused filesystems after some period of idleness, so it would satisfy the unmount criterion as well.

BTW: automount wouldn't mount at login per se, just when the home directory is accessed. This should be equivalent for your use (always available when the user logs in). But realize, say, if there's a cronjob that accesses the users home dir it would be mounted as well. This should be a good thing, but is different from what you asked for.

share|improve this answer
What about the user ID and group ID of the files in mounted /home directory in this case? Is it necessary to have exactly the same UIDs and GIDs on both computers? – v_2e Feb 5 '13 at 20:16
@v_2e it's recommended. If you do this, you want some naming directory service: NIS, LDAP, ActiveDirectory, etc. – Rich Homolka Feb 5 '13 at 20:26

It's possible with PAM.

If you use eCryptFS, it includes an pam_ecryptfs module. For everything else (including even encrypted filesystems), there is pam_mount.

share|improve this answer

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.