How do I centralise my home directories?

Notice: Page may contain affiliate links for which we may earn a small commission through services like Amazon Affiliates or Skimlinks.

el_pedr0

Member
Sep 6, 2016
44
1
8
47
I've got a small home network and I'd like to centralise the home directories of the Linux users so that they will always have access to the same home directory regardless of which machine they use to log on.

Is this wise? And if so, how best to achieve this?

I do have a server that is always on (and runs a number of VMs under Proxmox), and I am in the process of setting up FreeIPA, so all the user accounts will be centralised.
 

ttabbal

Active Member
Mar 10, 2016
743
207
43
47
It's not uncommon. NFS home is the common way. However, note that the users must have the same UID on the whole network. That's the number, not the name. With FreeIPA, I think this would work for you. Just enable autofs on the client machines and set up the NFS exports on the server.

Another method is to use SSHFS in the login script. If you have keys set up, the user won't need to enter their password again. You could do that all in a container under proxmox, so the keys can only access the data in the container. That should help with security if that's a concern. I would probably do it with NFS home too. Bind mount a ZFS filesystem into the container, and use that for the home directory storage.
 

MBastian

Active Member
Jul 17, 2016
205
59
28
Düsseldorf, Germany
It's not uncommon. NFS home is the common way. However, note that the users must have the same UID on the whole network. That's the number, not the name.
Only with NFSv3, NFSv4 has a new feature called id mapping. At least on CentOS 7 it is enabled per default and will match names and not UIDs/GIDs.
 
Last edited:

groove

Member
Sep 21, 2011
90
31
18
MBastian is right. With NFSv4 it is no longer necessary to match UIDs/GIDs. What is important to make this work throughout the *nix world (Solaris, Linux and BSD - at least Mac OS X) is to ensure that all systems are configured with a common 'NFS domain name'.

I have been able to get both user id and group ids with different UID, GID to 'match' across Solaris, Ubuntu, RHEL variants of Linux and Mac OSX. They are all configured with a 'NFS Domain' called something like 'nfs.myhome.domain' and thereafter NFS clients/shares are able to apply appropriate security with differnt UIDs/GIDs across systems.