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.

然后需要重新启动以下两个服务。

[root@linux ~]# /etc/init.d/ypserv restart

[root@linux ~]# /etc/init.d/yppasswdd restart

三、NIS客户端的设定。

1. 直接建立NIS域名称

[root@linux ~]# nisdomainname zwtnis

2. 开机立即启动此一NIS域名称

[root@linux ~]# vi /etc/rc.d/rc.local

# 加入底下这一行∶

/bin/nisdomainname zwtnis

3. 预设在启动 ypbind 时,设定 NIS 域名

[root@linux ~]# vi /etc/sysconfig/network

# 加入底下这一行∶NISDOMAIN=zwtnis

[root@linux ~]# vi /etc/hosts

192.168.1.202 master.zwtnis

192.168.1.100 client.zwtnis

4、启动bind

[root@linux ~]#authconfig-tui进入图形界面设定即可

5、NISclinet端的一些命令

yptest, ypwhich, ypcat,yppasswd

  1. LINUX下搭建DHCP和NIS服务器
  2. 安装Solaris后:9个主要设置以及NFS和NIS的配置
  3. linux下NIS服务的配置


相关内容