Configure NIS Server2010/06/10 |
Build NIS Server in order to share users' accounts among local networks. |
[root@master ~]# yum -y install ypserv [root@master ~]# ypdomainname srv.world # set NIS domain name [root@master ~]# vi /etc/sysconfig/network NETWORKING=yes HOSTNAME=master.srv.world NISDOMAIN=srv.world # add at the bottom [root@master ~]# vi /var/yp/Makefile # MERGE_PASSWD=true|false MERGE_PASSWD= false # line 42: change # # MERGE_GROUP=true|false MERGE_GROUP= false # line 46: change # # line 117: add all: passwd shadow group hosts rpc services netid protocols[root@master ~]# vi /var/yp/securenets host 127.0.0.1 255.255.255.0 10.0.0.0 [root@master ~]# /etc/rc.d/init.d/rpcbind start Starting rpcbind: [ OK ] [root@master ~]# /etc/rc.d/init.d/ypserv start Starting YP server services: [ OK ] [root@master ~]# /etc/rc.d/init.d/yppasswdd start Starting YP passwd service: [ OK ] [root@master ~]# chkconfig rpcbind on [root@master ~]# chkconfig ypserv on [root@master ~]# chkconfig yppasswdd on [root@master ~]# /usr/lib64/yp/ypinit -m # update NIS database At this point, we have to construct a list of the hosts which will run NIS servers. dlp.srv.world 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: dlp.srv.world next host to add: # push Ctrl + D key The current list of NIS servers looks like this: dlp.srv.world Is this correct? [y/n: y] y We need a few minutes to build the databases... Building /var/yp/srv.world/ypservers... gethostbyname(): Success Running /var/yp/Makefile... gmake[1]: Entering directory `/var/yp/srv.world' Updating passwd.byname... Updating passwd.byuid... Updating group.byname... Updating group.bygid... Updating shadow.byname... 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/srv.world' dlp.srv.world has been set up as a NIS master server. Now you can run ypinit -s dlp.srv.world on all slave server. # It's neccessary to update NIS database with following way if new user is added again [root@master ~]# cd /var/yp [root@master yp]# |
Sponsored Link |