NIS: How to allow access to both local and remote users' home directories?
Solution 1
What you can do is to setup an autofs mountpoint in, say, /home2. Then set each user's home directory as /home2/machine/user. If you set autofs to mount machine:/home in /home2/machine, then you have what you want, because the local /home can be mounted as /home2/localmachinename. And you can of course configure autofs via NIS.
Solution 2
If it's at all an option, I recommend making the “physical” location of each home directory something like /net/$hostname/$username
, i.e., include the name of the server as part of the path. Then arrange for /home/$username
to point to /home/$(server-of $username)/$username
.
One possibility is to make /home
a union mount of all the /net/*
.
Alternatively, you can make /home
an automount point and set up the automounter to mount /net/file-server/$username
for a NIS user or /home.local/$username
for a local user.
Solution 3
You can specify both local and remote mounts in an automounter config file (we use the /etc/auto.home
file).
We have:
/etc $ ypcat auto.master
-hosts
auto.direct --timeout=600
auto.home --timeout=1800
and
/etc $ cat /etc/auto.home
localadmin :/local/home/&
localuser :/local/home/&
+auto.home
/etc $
Obviously very late, but hopefully useful for someone.
Solution 4
What we do is mount the server's home on /mnt/server/export/home, then on other machines symlink each user's home directory into the local /home. This can be maintained semi-automatically across machines with rsync.
Related videos on Youtube
escouser
Updated on September 17, 2022Comments
-
escouser almost 2 years
We have a NIS server with shared users' home directories in '/home'.
We're used to mounting the server's '/home' using '/home' as the mount point on each NIS client.
However, if we do this with a machine that has existing local users, their home directories will not be accessible because '/home' is now a mount point to the server.
How can we make both local and remote users' home directories accessible on the client?