I would like to restrict access of certain users on my NIS setup to particular NIS clients. I have seen in several other posts that the ideal way to do this is with netgroups (Disable nis login for a particular user on a particular machine, Using NIS, can I allow only a subset of users to access a particular host?, Can I use netgroup at an NIS Client (Redhat) to restrict access to it?). I have tried following the steps outlined in these posts but the difficulty I am having is that I cannot get the netgroup to appear as a NIS map and I cannot find this explained anywhere. These are the steps that I have performed so far:
- On the NIS server I have modified the /etc/nsswitch.conf file so that compat mode is enabled. I have also changed the netgroup entry so it reads from the /etc/netgroup file (created in the next step). Here is the relevant portion of that file
passwd: compat shadow: compat group: compat passwd_compat: files sss shadow_compat: files sss group_compat: files sss netgroup: files sss
- Next I created the /etc/netgroup file on the NIS server. I created a simple group with a single user for testing:
Then I verified with getent that the netgroup was loaded:
$ getent netgroup test-group test-group ( ,testuser,)
- Next I rebuild NIS with
cd /var/yp && sudo make. Now, when I list the maps with
ypwhich -mI do not see any netgroup map (I am expecting to see a map like
netgroup.byhostbut I don't see any changes to the maps after rebuilding NIS).
Could somebody help me to know what is the next step for me to propagate the /etc/netgroup information into a NIS netgroup map?