NIS - Network Information System
What is NIS?
- a method of distributing information throughout networks.
- typical information is traditional /etc files like passwd.
- developed in the 1980s by Sun Microsystems.
- designed to allow centralised administration of many machines.
How does NIS operate?
- have NIS domains (not related to DNS domains).
- machines in a domain share configuration information.
- for a domain, NIS server machines keep the information,
and other machines send requests to them when they need it. E.g.,
when looking up a password entry.
- a domain has one master server which has the canonical
version of the information, and slave servers which have
copies of the information.
- the information is stored in maps, which are dbm format
key/value databases.
NIS Netgroups
- netgroup is a logical grouping of users or hosts.
- not related to unix groups.
- used for controlling access. E.g., putting a number of users
in the foo netgroup and adding +@foo to the password file of
a machine gives those users login access to that machine.
Linux and NIS
- Linux can easily be an NIS client.
- support for the NIS lookups is build into libc.
- need the ypclients-2.1.tar.gz clients.
- Can be a master, but support is not as complete, and you
will need a different C library. See the NIS HOWTO.
Setting Up NIS
- modify your /etc/rc.* boot files
- add domainname `cat /etc/defaultdomain`
to rc.net1 after the hostname setting line.
- add ypbind to rc.net2 after the lines
which run portmap and inetd.
edit /etc/defaultdomain to contain your NIS domainname.
- mkdir /var/yp
- add + entries to /etc/passwd, /etc/group
- add nis to /etc/host.conf to support nis host lookups.
E.g.: order hosts, bind, nis
NIS Commands
- for informational purposes - most NIS operation is hidden away
in the library calls.
- ypcat: show a map. E.g., ypcat passwd
- ypmatch: match a key in a map. E.g., ypmatch username passwd
- ypwhich: show which NIS server we are bound to.
Further Reading
- Linux NIS HOWTO
- Stern, Hal, Managing NFS and NIS, O'Reilly & Associates,
Inc, 1991. ISBN 0-937175-75-7.