[root@alicia ~]# yum install ypserver [root@alicia ~]# rpm -qa | grep yp ypbind-1.19-12.el5_6.1 ypserv-2.19-10.el5_9.1 yp-tools-2.9-2.el5
[root@alicia ~]# nisdomainname nis [root@alicia ~]# vi /etc/sysconfig/network 1 NETWORKING=yes 2 NETWORKING_IPV6=yes 3 HOSTNAME=alicia.net 4 NISDOMAIN=nis
[root@alicia ~]# vi /etc/rc.d/rc.local 1 #!/bin/sh 2 # 3 # This script will be executed *after* all the other init scripts. 4 # You can put your own initialization stuff in here if you don't 5 # want to do the full Sys V style init stuff. 6 7 touch /var/lock/subsys/local 8 nisdomainname nis
[root@alicia ~]# vi /etc/ypserv.conf 50 127.0.0.1/255.255.255.0 : * : * : none 51 10.8.118.0/255.255.255.0 : * : * : none 52 * : * : * : deny
[root@alicia ~]# useradd nis [root@alicia ~]# passwd nis Changing password for user nis. New UNIX password: BAD PASSWORD: it is based on a dictionary word Retype new UNIX password: passwd: all authentication tokens updated successfully.
[root@alicia ~]# service ypserv restart Stopping YP server services: [FAILED] Starting YP server services: [ OK ] [root@alicia ~]# /usr/lib/yp/ypinit -m At this point, we have to construct a list of the hosts which will run NIS servers. centos is in the list of NIS server hosts. Please continue to add the names for the other hosts, one per line. When you are done with the list, type a <control D>. next host to add: centos next host to add: alicia.net next host to add: alicia next host to add: The current list of NIS servers looks like this: centos alicia.net alicia Is this correct? [y/n: y] y We need a few minutes to build the databases... Building /var/yp/nis/ypservers... Running /var/yp/Makefile... gmake[1]: Entering directory `/var/yp/nis' Updating passwd.byname... Updating passwd.byuid... Updating group.byname... Updating group.bygid... Updating hosts.byname... Updating hosts.byaddr... Updating rpc.byname... Updating rpc.bynumber... Updating services.byname... Updating services.byservicename... Updating netid.byname... Updating protocols.bynumber... Updating protocols.byname... Updating mail.aliases... gmake[1]: Leaving directory `/var/yp/nis' centos has been set up as a NIS master server. Now you can run ypinit -s centos on all slave server.
[root@alicia ~]# service ypserv restart Stopping YP server services: [ OK ] Starting YP server services: [ OK ] [root@alicia ~]# service yppasswdd restart Stopping YP passwd service: [FAILED] Starting YP passwd service: [ OK ]
[root@Samsun ~]# rpm -qa | grep yp yp-tools-2.9-2.el5 ypbind-1.19-12.el5_6.1
[root@Samsun ~]# nisdomainname nis [root@Samsun ~]# vi /etc/sysconfig/network NETWORKING=yes NETWORKING_IPV6=yes HOSTNAME=Samsun NISDOMAIN=nis [root@Samsun ~]# vi /etc/rc.d/rc.local #!/bin/sh # # This script will be executed *after* all the other init scripts. # You can put your own initialization stuff in here if you don't # want to do the full Sys V style init stuff. touch /var/lock/subsys/local domainname nis ~
[root@Samsun ~]# vi /etc/hosts # Do not remove the following line, or various programs # that require network functionality will fail. 127.0.0.1 centos localhost.localdomain localhost Samsun Samsun.net ::1 localhost6.localdomain6 localhost6 10.8.118.100 alicia.net
[root@alicia ~]# vi /etc/yp.conf 22 ypserver alicia.net 23 domain nis
[root@alicia ~]# vi /etc/nsswitch.conf 28 # Example: 29 #passwd: db files nisplus nis 30 #shadow: db files nisplus nis 31 #group: db files nisplus nis 32 33 passwd: files nis 34 shadow: files nis 35 group: files nis
[root@alicia ~]# service ypbind restart Shutting down NIS services: [FAILED] Binding to the NIS domain: [ OK ] Listening for an NIS domain server.