5、启动服务
[root@linux ~]# /etc/init.d/portmap start # RPC服务
Starting portmap: [ OK ]
[root@linux ~]# /etc/init.d/ypserv start #NIS服务
Starting YP server services: [ OK ]
[root@linux ~]# /etc/init.d/yppasswdd start # yppasswdd提供NIS用户端密码修改功能Starting YP passwd service: [ OK ]
[root@linux ~]# rpcinfo -p localhost
program vers proto port
100000 2 tcp 111 portmapper
100000 2 udp 111 portmapper
100024 1 udp 898 status
100024 1 tcp 901 status
100004 2 udp 912 ypserv
100004 1 udp 912 ypserv
100004 2 tcp 915 ypserv
100004 1 tcp 915 ypserv
100009 1 udp 921 yppasswdd
6、在完成以上的步骤后,我们就需要在NIS服务器主机上将用户账号和密码建立成资料库。
直接通过 /usr/lib/yp/ypinit 这个指令来操作。
[root@linux ~]# /usr/lib/yp/ypinit -m
At this point, we have to construct a list of the hosts which will run NIS
servers. linux.yft.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: linux.yft.com
next host to add:
next host to add:
next host to add:
The current list of NIS servers looks like this:
linux.yft.com
Is this correct? [y/n: y] y
We need a few minutes to build the databases...
Building /var/yp/zwtnis/ypservers...
Running /var/yp/Makefile...
gmake[1]: Entering directory `/var/yp/zwtnis'
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/zwtnis'
linux.yft.com has been set up as a NIS master server.
Now you can run ypinit -s linux.yft.com on all slave server.