yp Commands NIS Management

The basic format of an entry in the etcnetgroup file is: groupname member [member] … where groupname Any name assigned to a netgroup. member An item included in the group, which can be: Another netgroup • Individual item defined by the triple: hostname, username, domainname • An omitted argument in the domainname field indicates the netgroup is valid in the current NIS domain; a hyphen − in the hostname and username fields means that no value is included.

17.3 NIS Management

Once NIS is set, it works quite well, hidden from users and in some ways even hidden from administrators. However, as everything else, NIS also requires maintenance — checking the NIS status and modifying and updating the NIS database are regular administrative duties. NIS is an extremely useful network service, but sometimes NIS can cause a lot of headaches. Usual UNIX commands cannot be efficiently used; that is why NIS has introduced a number of new commands to handle NIS processes and maps in order to make this management easier. Today these commands are mostly standard on every UNIX platform. A brief survey of some useful NIS−specific commands follows.

17.3.1 yp Commands

The NIS−specific commands we will call them yp −related commands live in several directories, most often bin, usrsbin, and usrlibnetsvcyp. It is very easy to recognize these commands; they start with the prefix yp. The following table briefly describes the commands the command layout is from Solaris 2.x; some differences are possible on other UNIX flavors: yp Command Description binypcat Prints all values in an NIS map; the −k option is required for the ypservers map: ypcat −k ypservers binypmatch Prints values of selected keys in an NIS map, for example to display password data for the user bjl: 413 ypmatch bjl passwd binyppasswd Changes the login password in the NIS database without affecting local data. It behaves very much like the regular passwd command. binypwhich Lists which host is a current NIS server and supplies NIS services for the host; very useful command to check the current binding of an NIS client toward available NIS servers. usrsbinypalias Changes aliases in the NIS database. usrsbinypinit Builds and installs NIS databases on a master or slave NIS server already discussed. usrsbinyppoll Queries a specified NIS server the default is the bound server for information about a specific NIS map. The information includes the time in seconds when the map was built, and a master server for the map. For example, to get information about the group map: usrsbinyppoll −h NISslave group or usrsbinyppoll group usrsbinypset Binds the client to a particular NIS server. It is useful for binding an NIS client that is not on a broadcast network, since broadcasting is a method by which the ypbind process a client locates an NIS server. If ypbind is already bound to a ypserv process, this command can have an effect only if ypbind was started with the −ypset option that allowed a change in the current binding this is specific to Solaris. usrlibnetsvcypypbind The NIS client process already discussed. usrlibnetsvcypyppush Forces a propagation of the specified NIS map database from the master server toward slave servers. usrlibnetsvcypypserv The NIS server process already discussed. usrlibnetsvcypypstart Starts and stops NIS services, ypstart automatically determines the usrlibnetsvcypypstop NIS configuration status of the system and starts the appropriate daemons, and ypstop stops the NIS daemons. 414 usrlibnetsvcypypxfr_1p erday usrlibnetsvcypypxfr_1p erhour usrlibnetsvcypypxfr_2p erday Template scripts for a periodic start of an NIS maps database transfer: once daily, once per hour, and twice daily. usrlibnetsvcypypxfrd The NIS database transfer daemon already discussed.

17.3.2 Updating NIS Maps