[CentOS] restricting access to an NIS netgroup

Wed Nov 9 23:32:10 UTC 2011
Ross Walker <rswwalker at gmail.com>

On Nov 9, 2011, at 8:53 AM, Mike VanHorn <michael.vanhorn at wright.edu> wrote:

>> You'll probably need to add a pam_access.so reference to the stock
>> /etc/pam.d/password-auth. Make the first "account" line
>>  account  required  pam_access.so
> My CentOS system doesn't have a stock password-auth file. I tried creating
> one with that line in it, but that didn't work. Also, per some web pages I
> found, I tried putting that line into system-auth, but that didn't work
> either.
>> Also, I assume that your system can access your netgroups properly,
>> i.e., getent can see them:
>>  getent netgroup $groupname
> Yes, that is working.
> Fortunately, the solution provided on-list by Stephen Harris did work, but
> I'm puzzled as to why this isn't.

Check out 'authconfig' man page.

It will setup your PAM and nsswitch files (and krb5.conf etc) appropriately. You just list the authentication mechanisms and their basic settings and it does the rest for you.