4.9 /etc/nsswitch.conf

nsswitch.conf文件不仅能处理主机表和DNS之间的优先次序,还能处理其它的问题。它为几个不同的系统管理数据库定义来源(多看几篇这句话,“几个不同的系统管理数据库”,可以是DNS,NIS)

由nsswitch.conf控制的数据库

alias EMAIL别名

ehters 用于RARP的以太网地址。

hosts   主机名和IP地址

password 用户帐号信息。

还有许多,没有列出来。

1.确保nsswitch.conf文件中包含为基本服务需要的资源遵循顺序

⑴ passwords :用户密码

⑵ group information :工作组

⑶ hosts :主机名

2.可以定义的资源files,dns,nis,nisplus,ldap和 db

Red Hat提供一个非常好的文档和可用的/etc/nsswitch.conf文件。总之,它优先查找的是:

file:(系统文件)

nisplus :NIS服务器

nis :NIS服务器

dns:(域名服务器)

ldap:ldap服务器

db:数据库

3./etc/nsswitch.conf文件内容

#

# /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: files

shadow: files

group: files

#hosts: db files nisplus nis dns

hosts: files 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

rpc: files

services: files

netgroup: files

publickey: nisplus

automount: files

aliases: files nisplus

etc   conf   nsswitch
发表评论
留言与评论(共有 0 条评论) “”
   
验证码:

相关文章

推荐文章