Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We use NIS to allow all our users to connect to any of our hosts. However, for one particular host, I want to restrict the users that can log in to a subset of the NIS users.

Is this possible?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

Yes, you can setup a netgroup and only place the users you want in that netgroup. Then on the host server that you want to restrict access you modify your nsswitch.conf accordingly and then place the netgroup in your /etc/passwd and /etc/shadow. ie:

+@netgroupname:x:::::

I've done this before but can't quiet recall all the specifics. But netgroups is definitely the way you want to go. Netgroups also work well in LDAP for this purpose, if you ever decide to migrate to it some day.

Keep in mind the approach for Linux vs. Unix may differ slightly.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.