redhat – 什么是nsswitch compat模式?

前端之家收集整理的这篇文章主要介绍了redhat – 什么是nsswitch compat模式?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
Red Hat建议我在/etc/nsswitch.conf中使用compat模式作为枚举LDAP用户的选项之一,但后来说它不是一个常用的方法.
nsswitch.conf
passwd: files compat
passwd_compat: ldap

in passwd file,add +@netgroup.

什么是这种比较模式?

解决方法

这篇摘录摘自Linux倡导者Evi Nemeth(不幸的是最近在海上失败了 http://www.theregister.co.uk/2013/07/05/evi_nemeth_unix_dead/)写的第一本也是最好的Linux管理书之一:Linux®Administration手册.对于这种情况,它出现在本书的第二版中,我不确定这本书的最新版本是否重复,因为当时的NIS和NIS不太相关.

Configuration information can be distributed in several ways. Every
system understands flat files and knows how to use DNS to look up
hostnames and Internet addresses. Most also understand NIS. Since a
given piece of information could come from several potential sources,
Linux provides a way for you to specify the sources that are to be
checked and the order in which the checks are made.

In the original (pre-Linux) implementation of NIS,some configuration
files (the /etc/passwd and /etc/group files in particular) had to be
configured to “invite in” the contents of the corresponding NIS maps.
The invitation was extended by inclusion of special incantations in
the files themselves. A lone “+” at the beginning of a line would
include the entire NIS map,“+@netgroup” would include only entries
relevant to a given netgroup,and “+name” would include a single
entry.

This approach was never very well liked,and it has been superseded by
a central config file,/etc/nsswitch.conf,that allows an explicit
search path to be specified for each type of administrative
information. The original behavior can be emulated by use of a
compatibility mode,but it’s unlikely you would want to use this
feature on a newly configured network. (Unfortunately,emulation is
most distributions’ default.)

The common sources are nis,nisplus,files,dns,and compat; they refer to NIS,NIS+,[5] vanilla flat files (ignoring tokens such as “+”),DNS,and NISified flat files (honoring “+”),respectively.

原文链接:https://www.f2er.com/linux/401937.html

猜你在找的Linux相关文章