3

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.

Thanks!

2 Answers 2

3

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.

2
  • 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, 2013 at 20:16
  • @v_2e it's recommended. If you do this, you want some naming directory service: NIS, LDAP, ActiveDirectory, etc. Feb 5, 2013 at 20:26
2

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.

1
  • is the basic premise here that the ecyptfs provides a virtual file system with the desired files for the end user, but exposes only an encrypted file for the whole user home directory to the Network file system mount? So the remove server only ever handles the encrypted data, and can only be decrypted by the user on login on the local machine? Sep 4, 2016 at 5:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .