The /etc/netgroup file

The /etc/netgroup file defines groups of clients

The filer /etc/netgroup file defines groups of clients that the filer uses for checking access permission while processing a mount request.

Syntax

The following line shows the syntax for each line in the /etc/netgroup file:

groupname member-list
Limits

Each line in the /etc/netgroup file is limited to 4,096 characters.

Member-list syntax

Each element in member-list is

Restrictions

You cannot use netgroup names with the -rw and -root options.

Changes take effect immediately

Changes made to the netgroup file take effect immediately.

Example of /etc/netgroups

The following lines show an example of a /etc/netgroups file:

trusted-hosts (adminhost,,)
untrusted-hosts (bashful,,) (dopey,,) (sleepy,,)
all-hosts trusted-hosts untrusted-hosts

Example of /etc/exports using netgroups

The following lines show an example of an /etc/exports file that uses netgroup group names:

/vol/vol0 -access=trusted-hosts,root=adminhost 
/vol/vol0/home -access=all-hosts,root=adminhost

Copy /etc/netgroup when filer doesn't use NIS

If your filer is not configured as an NIS client, the network groups on the filer are not linked with NIS.

Must copy NIS netgroup file

You must copy an existing NIS network group over to /vol/vol0/etc/netgroup on the filer before the exportfs command can use it.

Automating copying with a Makefile

You can modify the Makefile of the NIS master to copy the NIS master's /etc/netgroup file to the filer when it is changed.

Example Makefile

The following lines of code in the NIS Makefile section for netgroup.time copy the /etc/netgroup file to filers named toaster1, toaster2, and toaster3; substitute the name of your filers in the "for" list, in place of toaster1, toaster2, and toaster3, and add any other filer names to which you want the file copied:

@mntdir=/tmp/nac_etc_mnt_$$$$;\
if [ ! -d $$mntdir ]; then rm -f $$mntdir; mkdir $$mntdir; fi;\
for filer in toaster1 toaster2 toaster3 ; do \
mount $$filer:/vol/vol0/etc $$mntdir;\
mv $$mntdir/netgroup $$mntdir/netgroup.bak;\
cp /etc/netgroup $$mntdir/netgroup;\
umount $$mntdir;\
done;\
rmdir $$mntdir

Copyright © 1999, Network Appliance, Inc. All rights reserved.

Part No. 210-02334
File: nfs7.htm
Last updated: 02/24/99 12:16:26