1 SRT210 The Pragmetic art of Administration NIS Server Raymond Chan Seneca College of Applied Technology School of Information & Communications Technology
2 What is NIS? A Name Service developed by Sun Microsystems Formerly known as Sun Yellow Pages (YP) (most NIS program names begin with yp ) The name Yellow Pages TM is a registered trademark in the United Kingdom of British Telecom and Sun Microsystems was required to drop that name and rename it to NIS
3 Why NIS? To make the use of network services transparent to the user (Network user accounts) To make it easier to manage the network (no need to duplicate information unnecessarily) To improve data consistency stores important administrative information centrally To make the system/network administrator's life much easier
4 NIS Objective To provide information, that has to be known throughout the network, to all machines on the network. Login names/passwords/home directories/host name to IP mapping (/etc/passwd, /etc/shadow, /etc/hosts) Group information (/etc/group) Host name/ip mapping (/etc/hosts)...
5 How does NIS work? At lease one NIS server, which keeps the NIS databases (aka map file), running on the network. NIS server listens to requests from NIS Clients for name service (ns). NIS Clients communicate with the NIS Server by using Remote Procedure Calls (RPCs) NIS Clients only contact NIS Server in the same Domain (NIS domain, not DNS domain)
6 NIS Components Domains (can be set in /etc/sysconfig/network) Maps ( stored in /var/yp/[nis domain name]/) Daemons (ypserv, ypbind, etc...) Utilities (ypcat...) NIS Command Set (as an exercise)
7 NIS Domain NIS Domain is a collection of machines that share a common set of NIS maps Each Domain has a Domain name Each Machine sharing the common set of maps belongs to that domain Domain names are case sensitive Any machine can belong to a given domain provided there is a server for that domain
8 NIS Maps NIS maps are essentially two column tables Key Information related to the key A set of NIS Maps are maintained on the NIS master server NIS slave server gets copies of the NIS maps from the master server Configuration stored in /var/yp/makefile
9 NIS Daemons NIS Service is provided by five daemons: ypserv NIS server process ypbind NIS client binding process ypxfr master to slave map transfer process rpc.yppasswd NIS password update process rpc.ypupdated modifies maps
10 NIS Utilities makedbm creates dbm file for an NIS map ypcat lists data in a map ypinit builds and installs an NIS database and initializes NIS client's ypservers list ypmatch finds a specific entry in a map yppoll gets a map order number from a server
11 NIS Utilities yppush propagates data from NIS master to NIS slave server ypset sets binding to a particular server ypwhich lists name of the NIS server and nickname translation table ypxfr transfers map data from master to slave NIS server
12 NIS Commands Command ypserv ypbind Description Services NIS clients' requests for information from a NIS map. Ypserv is a daemon that runs on NIS servers with a complete set of maps. At least one ypserv daemon must be present on the network for NIS service to function. Bind to a ypserv process that serves maps within the domain of the requesting client. Ypbind must run on all servers and clients
13 NIS Commands (2) Command ypinit Description Automatically creates maps for an NIS server from the input files. Use ypinit to setup the master and slave NIS servers for the first time. make Use make to updates NIS maps by reading the Makefile (when run in the /var/yp directory) Refer to the ypmake man page for more details.
14 Command line Machine & Domain Name Use hostname to set machine name Use domainname= to set NIS domain name Files : /etc/sysconfig/network set machine name at boot time with HOSTNAME=your host name set NIS domain name at boot time with NISDOMAIN=your nis domain name
15 Server Configuration Prepare the master server place the source files in the proper directories for creating the NIS maps (normally in /etc ) Modify NIS master server configuration file /var/yp/makefile Start the NIS daemons on the NIS master server Create NIS databases map files on the NIS server Configure NIS slave server (if needed)
16 NIS Master Server Check the contents of the following source files (group A files) and copy them to a directory of your choice : /etc/hosts /etc/passwd /etc/services /etc/protocols /etc/networks /etc/group /etc/rpc /etc/aliases
17 Master Server Configuration File /var/yp/makefile Back it up first > /var/yp/makefile.org NOPUSH Y(One Server)/N(Slave Server) MINUID=1000 MINGID=1000 MERGE_PASSWD(/etc/shadow) MERGE_GROUP(/etc/gshadow)
18 Create the Map files Set the NIS Domain Name (How?) Start the NIS Server (ypserv) Use the following ypinit command to build a fresh set of NIS maps base on the information in /var/yp/makefile # /usr/lib/yp/ypinit m Or /usr/lib64/yp/ypinit m on a 64 bit system
19 Starting NIS Service Starts automatically at system boot chkconfig level 35 ypserv on Starts at command line: service ypserv start
20 Stopping NIS Service Use the following command: service ypserv stop Turn off ypserv for good: chkconfig level 12345 ypserv off
21 Questions Q & A