Configure NIS Server2015/12/02 |
Configure NIS Server in order to share users' accounts in your local networks.
|
|
[1] | Configure NIS Server. |
dlp:~ #
zypper -n install ypserv # set NIS domain name dlp:~ # ypdomainname srv.world dlp:~ # echo "srv.world" > /etc/defaultdomain
dlp:~ #
vi /var/yp/Makefile
# MERGE_PASSWD=true|false
# line 37: change MERGE_PASSWD= false
# MERGE_GROUP=true|false
# line 42: change MERGE_GROUP= false
# line 109: add all: passwd shadow group rpc services netid
dlp:~ #
vi /var/yp/securenets # comment out # 0.0.0.0 0.0.0.0
# add IP addresses you allow to access to NIS server 255.255.255.0 10.0.0.0
dlp:~ #
vi /etc/hosts # add own host for NIS database 10.0.0.30 dlp.srv.world dlp /etc/init.d/rpcbind start dlp:~ # /etc/init.d/ypserv start dlp:~ # /etc/init.d/ypxfrd start dlp:~ # /etc/init.d/yppasswdd start dlp:~ # chkconfig rpcbind on dlp:~ # chkconfig ypserv on dlp:~ # chkconfig ypxfrd on
dlp:~ #
chkconfig yppasswdd on # update NIS database dlp:~ # /usr/lib/yp/ypinit -m
At this point, we have to construct a list of the hosts which will run NIS
servers. dlp 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 next host to add: # Ctrl + D key The current list of NIS servers looks like this:
dlp.srv.world
Is this correct? [y/n: y]
y # y key We need a few minutes to build the databases... Building /var/yp/srv.world/ypservers... Running /var/yp/Makefile... gmake[1]: Entering directory `/var/yp/srv.world' Updating passwd.byname... Updating passwd.byuid... Updating shadow.byname... 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/srv.world'
dlp has been set up as a NIS master server.
Now you can run ypinit -s dlp on all slave server.
# If you added users in local server, apply them to NIS database, too. dlp:~ # cd /var/yp dlp:/var/yp # |
Sponsored Link |