Solaris 10安装配置NIS服务及RHEL客户端配置

前面介绍过RHEL下的NIS安装及配置[Redhat Linux安装配置NIS服务],作为从SUN Solaris系统移植过来的服务,这里看看solaris下是如何配置的。


  • NIS服务器:Solaris 10
  • NIS客户端:RHEL 6



 # cat /etc/hosts solaris.liusuping.com client.liusuping.com  ##RHEL 客户端

设置NIS 域名

#domainname liusuping.com 


#cat /etc/defaultdomain 


 修改 /etc/nsswitch.conf配置文件

# cat /etc/nsswitch.conf


# /etc/nsswitch.files:


# An example file that could be copied over to /etc/nsswitch.conf; it

# does not use any naming service.


# "hosts:" and "services:" in this file are used only if the

# /etc/netconfig file has a "-" for nametoaddr_libs of "inet" transports.

passwd:     files nis

group:      files nis

hosts:      files nis


# useradd liu

# useradd suping

# passwd liu

# passwd suping


# touch /etc/ethers

# touch /etc/netgroup

# touch /etc/bootparams


# vi  /etc/timezone

GMT+8:00 en_US


# ypinit -m

In order for NIS to operate sucessfully, we have to construct a list of the 

NIS servers.  Please continue to add the names for YP servers in order of

preference, one per line.  When you are done with the list, type a <control D>

or a return on a line by itself.

        next host to add:  solaris

        next host to add:  ^D

The current list of yp servers looks like this:




Is this correct?  [y/n: y]  


Installing the YP database will require that you answer a few questions.

Questions will all be asked at the beginning of the procedure.


Do you want this procedure to quit on non-fatal errors? [y/n: n]  

OK, please remember to go back and redo manually whatever fails.  If you

don't, some part of the system (perhaps the yp itself) won't work.

The yp domain directory is /var/yp/liusuping.com

Can we destroy the existing /var/yp/liusuping.com and its contents? [y/n: n]  y

There will be no further questions. The remainder of the procedure should take

5 to 10 minutes.

Building /var/yp/liusuping.com/ypservers...

Running /var/yp /Makefile...

updated passwd

updated group

updated hosts

updated ipnodes

updated ethers

updated networks

updated rpc

updated services

updated protocols

updated netgroup

updated bootparams

/var/yp/liusuping.com/mail.aliases: 12 aliases, longest 10 bytes, 138 bytes total

/usr/lib/netsvc/yp/mkalias /var/yp/`domainname`/mail.aliases /var/yp/`domainname`/mail.byaddr;

updated aliases

updated publickey

updated netid

/usr/sbin/makedbm /etc/netmasks /var/yp/`domainname`/netmasks.byaddr; 

updated netmasks

updated timezone

updated auto.master

updated auto.home

updated ageing

updated auth_attr

updated exec_attr

updated prof_attr

updated user_attr

updated audit_user


solaris has been set up as a yp master server without any errors.


If there are running slave yp servers, run yppush now for any data bases

which have been changed.  If there are no running slaves, run ypinit on

those hosts which are to be slave servers.


# ps -ef |grep yp

  daemon   113     1   0 21:03:18 ?           0:00 /usr/lib/crypto/kcfd

    root  2176     1   0 21:56:18 ?           0:00 /usr/lib/netsvc/yp/ypbind

    root  2177  1185   0 21:57:14 pts/3       0:00 grep yp

    root  1486     1   0 21:41:20 ?           0:00 /usr/lib/netsvc/yp/ypxfrd

    root  1497     1   0 21:41:21 ?           0:00 /usr/lib/netsvc/yp/rpc.ypupdated

    root  1494     1   0 21:41:20 ?           0:00 /usr/lib/netsvc/yp/rpc.yppasswdd -m

    root  1485     1   0 21:41:20 ?           0:00 /usr/lib/netsvc/yp/ypserv -d

 RHEL Client客户端配置

 修改/etc/hosts文件 solaris.liusuping.com client.liusuping.com  ##RHEL 客户端


[root@client ~]# vi /etc/nsswitch.conf 

passwd:     files nis

shadow:     files nis

group:      files nis


#hosts:     db files nisplus nis dns

hosts:      files nis dns


[root@client ~]# yum install ypbind


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





[root@client ~]# cat /etc/rc.local 



# This script will be executed *after* all the other init scripts.

# You can put your own initialization stuff in here if you don't

# want to do the full Sys V style init stuff.

/bin/nisdomainname liusuping.com

touch /var/lock/subsys/local


[root@client ~]# service ypbind restart

关闭 NIS 服务:[确定]

启动 NIS 服务:[确定]

绑定 NIS 服务:.[确定]


[root@client ~]# ypwhich



« 上一篇下一篇 »