Is it possible to serve certain files via NIS only to a group of clients and not to all of them? It's probably a very easy task but I'm searching for a while now and don't seem to find an answer. I'm also pretty new to the subject and not really sure for what to search.
So lets say I have one server (host1
) that exports a directory via NFS. So the file /etc/exports
looks for instance like this:
/usr/local 192.168.0.1(rw,no_root_squash)
Now I want to serve a directory inside /usr/local
to some client machines. So I edit the file /etc/auto.master
on the NIS server and add the following line:
/usr/local/apps auto.appXY
and I create a file auto.appXY
with the following content:
appXY -rw,hard,intr host1:/usr/local/appXY
When I have now two clients
client1: 192.168.0.1
client2: 192.168.0.2
then only client1 will actually receive the content of /usr/local/appXY
because only its IP address was used in /etc/exports
. The problem is, that there will be nevertheless an empty directory apps
mounted in /usr/local
on client2. Which means means that I can't have a local directory called apps
because its content will not appear.
So I read this answer:
How to prevent autofs from mounting over specific directories?
which describes a way of dealing with this by editing the /etc/auto.master
file on each client. This might work but I was really hoping to find a server side solution.
So here again my question:
Can I configure my NIS server to serve a different auto.master
file to different clients? Or can I in some other way realize to automount directories only on specific clients, so that on all the other clients nothing gets overmounted?