分类: LINUX
2008-04-04 14:25:50
#################################1.安装NIS Server
Author:atyu30(iopenbsd#gmail.com)
Data: 08/04/04
HK_client--
| |
| |
|---Master |
| || |
| slave---|
| |
| |
BJ_client
################################
Master:
4.生成NIS数据库5.共享的资源
# /usr/lib/yp/ypinit -m
At this point, we have to construct a list of the hosts which will run NIS
servers. master.atyu30.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.
next host to add: master.atyu30.com
next host to add:
The current list of NIS servers looks like this:
master.atyu30.com
Is this correct? [y/n: y] y
We need a few minutes to build the databases...
Building /var/yp/(none)/ypservers...
Running /var/yp/Makefile...
gmake[1]: Entering directory `/var/yp/(none)'
Updating passwd.byname...
failed to send 'clear' to local ypserv: RPC: Port mapper failureUpdating passwd.byuid...
failed to send 'clear' to local ypserv: RPC: Port mapper failureUpdating group.byname...
failed to send 'clear' to local ypserv: RPC: Port mapper failureUpdating group.bygid...
failed to send 'clear' to local ypserv: RPC: Port mapper failureUpdating hosts.byname...
failed to send 'clear' to local ypserv: RPC: Port mapper failureUpdating hosts.byaddr...
failed to send 'clear' to local ypserv: RPC: Port mapper failureUpdating rpc.byname...
failed to send 'clear' to local ypserv: RPC: Port mapper failureUpdating rpc.bynumber...
failed to send 'clear' to local ypserv: RPC: Port mapper failureUpdating services.byname...
failed to send 'clear' to local ypserv: RPC: Port mapper failureUpdating services.byservicename...
failed to send 'clear' to local ypserv: RPC: Port mapper failureUpdating netid.byname...
failed to send 'clear' to local ypserv: RPC: Port mapper failureUpdating protocols.bynumber...
failed to send 'clear' to local ypserv: RPC: Port mapper failureUpdating protocols.byname...
failed to send 'clear' to local ypserv: RPC: Port mapper failureUpdating mail.aliases...
failed to send 'clear' to local ypserv: RPC: Port mapper failuregmake[1]: Leaving directory `/var/yp/(none)'
master.atyu30.com has been set up as a NIS master server.
Now you can run ypinit -s master.atyu30.com on all slave server.
SlaveClient
1.安装NIS Server
# yum install ypbind ypserv
2.正名
# cat /etc/hosts
10.0.0.150 master.atyu30.com master
10.0.0.160 slave.atyu30.com slave
10.0.0.170 client1.atyu30.com client1
3.指定NISDOAMIN
# vi /etc/sysconfig/network
+ NISDOMAIN=master
4.启动NIS Server
# /etc/init.d/portmap restart
# /etc/init.d/ypbind restart
# /etc/init.d/yppasswdd restart
5.与master同步数据
# /usr/lib/yp/ypinit -s master
6.添加启动项
# chkconfig portmap 235 on
# chkconfig ypbind 235 on
# chkconfig yppasswdd on
4. # vi /etc/nsswitch.conf
passwd: files nis
shadow: files nis
group: files nis
hosts: files nis dns
5.# vi /etc/sysconfig/authconfig
USENIS=yes
6. # vi /etc/pam.d/system-auth
password sufficient pam_unix.so md5 shadow nis nullok try_first_pass use_authtok
7. # vi /etc/yp.conf
domain slave broadcast