RHEL 5.8
# cd /usr/share/doc/ypserv-2.19 # cp securenets /var/yp # cd /var/yp # vi securenets -------------------------------------- # Always allow access for localhost 255.0.0.0 127.0.0.0 255.255.255.0 192.168.1.0 # This line gives access to everybody. PLEASE ADJUST! #0.0.0.0 0.0.0.0 --------------------------------------
# ypdomainname nisdomain.example.com # service ypserv start
# /usr/lib64/yp/ypinit -m
At this point, we have to construct a list of the hosts which will run NIS servers. ns.nisdomain.example.com 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: ns.nisdomain.example.com next host to add: The current list of NIS servers looks like this: ns.nisdomain.example.com Is this correct? [y/n: y] y We need a few minutes to build the databases... Building /var/yp/nisdomain.example.com/ypservers... Running /var/yp/Makefile... gmake[1]: ディレクトリ `/var/yp/nisdomain.example.com' に入ります 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]: ディレクトリ `/var/yp/nisdomain.examplecom' から出ます ns.nisdomain.example.com has been set up as a NIS master server. Now you can run ypinit -s ns.nisdomain.example.com on all slave server. #
# service yppasswdd start
/etc/sysconfig/network に以下の行を追加
START_YPSERV=yes START_YPPASSWDD=yes START_YPBIND=yes NISDOMAIN=nisdomain.example.com
/etc/yp.conf に以下の行を追加
domain nisdomain.example.com server 127.0.0.1
# chkconfig ypserv on # chkconfig yppasswd on # chkconfig ypbind on