方法:#/usr/lib/yp/ypinit –s 主NIS服务器主机名/IP地址 实例:#/usr/lib/yp/ypinit –s nisserver
方法二:#vi /etc/sysconfig/network NIS_DOMAIN=域名
广播法可以在该文件中加上如下内容: domain 域名 broadcast 点到点方法可以在该文件中加上如下内容: domain 域名 server NIS服务器的主机名/IP地址 实例:采用点到点方法指定abc域的服务器为nisserver #vi /etc/yp.conf domain abc server nisserver
# /etc/nsswitch.conf # # An example Name Service Switch config file. This file should be # sorted with the most-used services at the beginning. # # The entry '[NOTFOUND=return]' means that the search for an # entry should stop if the search in the previous entry turned # up nothing. Note that if the search failed due to some other reason # (like no NIS server responding) then the search continues with the # next entry. # # Legal entries are: # # nisplus or nis+ Use NIS+ (NIS version 3) # nis or yp Use NIS (NIS version 2), also called YP # dns Use DNS (Domain Name Service) # files Use the local files # db Use the local database (.db) files # compat Use NIS on compat mode # hesiod Use Hesiod for user lookups # [NOTFOUND=return] Stop searching if not found so far # # To use db, put the "db" in front of "files" for entries you want to be # looked up first in the databases # # Example: #passwd: db files nisplus nis #shadow: db files nisplus nis #group: db files nisplus nis passwd: nisplus files shadow: nisplus files group: nisplus files #hosts: db files nisplus nis dns hosts: files nisplus dns # Example - obey only what nisplus tells us... #services: nisplus [NOTFOUND=return] files #networks: nisplus [NOTFOUND=return] files #protocols: nisplus [NOTFOUND=return] files #rpc: nisplus [NOTFOUND=return] files #ethers: nisplus [NOTFOUND=return] files #netmasks: nisplus [NOTFOUND=return] files bootparams: nisplus [NOTFOUND=return] files ethers: files netmasks: files networks: files protocols: files nisplus rpc: files services: files nisplus netgroup: files nisplus publickey: nisplus automount: files nisplus aliases: files nisplus 说明:系统中的一些重要的信息可以从本机的文件中查询(files),也可以从NIS服务器中查询(nis),或者从数据库(db)及dns中查询
格式:ypcat 文件名 实例:#ypcat passwd
|