Pick a Free OS

User login

Navigation

NIS on Linux

When running a local area network, one of the goals is usually to provide an environment to the users that make the network transparent. An important step for this is to keep vital data such as user account information (e.g. /etc/hosts, /etc/passwd and /etc/group files) synchronized between all hosts. For host name resolution, a powerful and sophisticated service - DNS exists. For other tasks, there is no such specialized service. Moreover, if you manage only a small closed intranet without Internet connectivity, setting up DNS may not seem worth the trouble for many administrators.


This led to the development of NIS, the Network Information System. NIS provides simple and generic client-server database access facilities that can be used to distribute information such as that contained in the passwd and groups files to all hosts on your network. This makes the network appear just as a single system, with the same accounts on all hosts.


NIS is based on RPC, and comprises a server, a client-side library, and several administrative tools. Originally, NIS was called Yellow Pages, or YP, which is still widely used to informally refer this service. On the other hand, Yellow Pages is a trademark of British Telecom, which required Sun to drop that name. As things go, some names stick with people, and so YP lives on as a prefix to the names of most NIS-related commands such as ypserv, ypbind, etc.


There are some configuration files, which are not host specific but they are to be maintained and synchronized over all the hosts. /etc/passwd, /etc/group and /etc/hosts are such files. NIS enables us to set up a master server where such files are stored and set up other machines on the network as clients to this server. Future references to these files on the client side would lead to a consultation with the server.


But first, the files to be sharable via NIS should meet two requirements. Firstly, the file must be tabular with at least one entry that is unique in the file (e.g. the login or UID entry in the /etc/passwd file). Secondly, the file should be a plain text file.