nsswitch.conf.5: Light edits to Mark Bannister's changes

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2012-03-29 11:29:00 +13:00
parent 79e2fba2d9
commit 9aa96150d0
1 changed files with 56 additions and 64 deletions

View File

@ -18,31 +18,30 @@
.\" .\"
.\" You should have received a copy of the GNU General Public .\" You should have received a copy of the GNU General Public
.\" License along with this manual; if not, write to the Free .\" License along with this manual; if not, write to the Free
.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
.\" USA. .\" MA 02111, USA.
.\" .\"
.TH NSSWITCH.CONF 5 2011-10-13 "Linux" "Linux Programmer's Manual" .TH NSSWITCH.CONF 5 2012-03-29 "Linux" "Linux Programmer's Manual"
.SH NAME .SH NAME
nsswitch.conf \- Name Service Switch configuration file nsswitch.conf \- Name Service Switch configuration file
.SH DESCRIPTION .SH DESCRIPTION
The The
.I /etc/nsswitch.conf .I /etc/nsswitch.conf
file is a configuration file used by the GNU C Library to determine from ("Name Server Switch", NSS)
what sources to obtain name service information in a range of categories, file is a configuration file used by the GNU C Library to determine
the sources from which to obtain name-service information in
a range of categories,
and in what order. and in what order.
Each category of information is identified by a database name. Each category of information is identified by a database name.
.LP .LP
The file is plain ASCII text, with columns separated by spaces or tab The file is plain ASCII text, with columns separated by spaces or tab
characters. characters.
The first column defines the database name. The first column specifies the database name.
The remaining columns describe the order of sources to query and a The remaining columns describe the order of sources to query and a
limited limited set of actions that can be performed by lookup result.
set of actions that can be performed by lookup result.
.LP .LP
The following databases are made available by the standard The following databases are understood by the GNU C Library:
GNU C Library: .TP 12
.RS 3
.TP 10
.B aliases .B aliases
Mail aliases, used by Mail aliases, used by
.BR getaliasent (3) .BR getaliasent (3)
@ -62,8 +61,8 @@ Host names and numbers, used by
and related functions. and related functions.
.TP .TP
.B netgroup .B netgroup
Network wide list of hosts and users, used for access rules. Network-wide list of hosts and users, used for access rules.
C libraries before glibc 2.1 only supported netgroups over NIS. C libraries before glibc 2.1 supported netgroups only over NIS.
.TP .TP
.B networks .B networks
Network names and numbers, used by Network names and numbers, used by
@ -97,13 +96,12 @@ and related functions.
Shadow user passwords, used by Shadow user passwords, used by
.BR getspnam (3) .BR getspnam (3)
and related functions. and related functions.
.RE
.LP .LP
Here is an example Here is an example
.I /etc/nsswitch.conf .I /etc/nsswitch.conf
file: file:
.LP .LP
.RS 3 .RS 4
.PD 0 .PD 0
.TP 16 .TP 16
passwd: passwd:
@ -138,16 +136,13 @@ nis [NOTFOUND=return] files
.LP .LP
The first column is the database name. The first column is the database name.
The remaining columns specify: The remaining columns specify:
.RS 3 .IP * 3
.TP 3 One or more service specifications e.g., "files", "db", or "nis".
o The order of the services on the line determines the order in which
One or more service specifications e.g. "files", "db", or "nis".
The order the services appear on the line determine the order in which
those services will be queried, in turn, until a result is found. those services will be queried, in turn, until a result is found.
.TP .IP *
o
Optional actions to perform if a particular result is obtained Optional actions to perform if a particular result is obtained
from the preceding service, e.g. "[NOTFOUND=return]". from the preceding service, e.g., "[NOTFOUND=return]".
.RE .RE
.LP .LP
The service specifications supported on your system depend on the The service specifications supported on your system depend on the
@ -158,8 +153,15 @@ will provide the named
.IR SERVICE . .IR SERVICE .
On a standard installation, you can use On a standard installation, you can use
"files", "db", "nis", and "nisplus". "files", "db", "nis", and "nisplus".
For the hosts database, you can additionally specify "dns". For the
For the passwd, group, and shadow databases, you can additionally specify .B hosts
database, you can additionally specify "dns".
For the
.BR passwd ,
.BR group ,
and
.BR shadow
databases, you can additionally specify
"compat" (see "compat" (see
.B "Compatibility mode" .B "Compatibility mode"
below). below).
@ -169,28 +171,20 @@ may be 1 for glibc 2.0, or 2 for glibc 2.1 and later.
On systems with additional libraries installed, you may have access to On systems with additional libraries installed, you may have access to
further services such as "hesiod", "ldap", "winbind" and "wins". further services such as "hesiod", "ldap", "winbind" and "wins".
.LP .LP
An action may also be specified following a service specification, that An action may also be specified following a service specification.
modifies behaviour following a result obtained from the preceding data The action modifies the behaviour following a result obtained
source. from the preceding data source.
Action items take the general form: Action items take the general form:
.LP .LP
.RS 3 .RS 4
[ .RI [ STATUS = ACTION ]
.I STATUS
=
.I ACTION
]
.br .br
[ ! .RI [! STATUS = ACTION ]
.I STATUS
=
.I ACTION
]
.RE .RE
.LP .LP
where where
.LP .LP
.RS 3 .RS 4
.I STATUS .I STATUS
=> =>
.B success .B success
@ -210,14 +204,14 @@ where
.LP .LP
The ! negates the test, matching all possible results except the The ! negates the test, matching all possible results except the
one specified. one specified.
The case of the keywords is insignificant. The case of the keywords is not significant.
.LP .LP
The The
.I STATUS .I STATUS
value is matched against the result of the lookup function called by value is matched against the result of the lookup function called by
the preceding service specification, and can be one of: the preceding service specification, and can be one of:
.RS 3 .RS 4
.TP 10 .TP 12
.B success .B success
No error occurred and the requested entry is returned. No error occurred and the requested entry is returned.
The default action for this condition is "return". The default action for this condition is "return".
@ -228,8 +222,8 @@ The default action for this condition is "continue".
.TP .TP
.B unavail .B unavail
The service is permanently unavailable. The service is permanently unavailable.
This can either mean the This can mean either that the
required file cannot be read, or, for network services, the server required file cannot be read, or, for network services, that the server
is not available or does not allow queries. is not available or does not allow queries.
The default action for this condition is "continue". The default action for this condition is "continue".
.TP .TP
@ -243,8 +237,8 @@ The default action for this condition is "continue".
The The
.I ACTION .I ACTION
value can be one of: value can be one of:
.RS 3 .RS 4
.TP 10 .TP 12
.B return .B return
Return a result now. Return a result now.
Do not call any further lookup functions. Do not call any further lookup functions.
@ -258,7 +252,7 @@ additionally permits special entries in
.I /etc/passwd .I /etc/passwd
for granting users or members of netgroups access to the system. for granting users or members of netgroups access to the system.
The following entries are valid in this mode: The following entries are valid in this mode:
.RS 3 .RS 4
.TP 12 .TP 12
.BI + user .BI + user
Include the specified Include the specified
@ -279,14 +273,14 @@ Exclude all users in the given
.IR netgroup . .IR netgroup .
.TP .TP
.B + .B +
Include every user, except previously excluded ones, in the Include every user, except previously excluded ones, from the
NIS passwd map. NIS passwd map.
.RE .RE
.LP .LP
By default the source is "nis", but this may be By default the source is "nis", but this may be
overridden by specifying "nisplus" as source for the pseudo-databases overridden by specifying "nisplus" as the source for the pseudo-databases
.BR passwd_compat , .BR passwd_compat ,
.B group_compat .BR group_compat ,
and and
.BR shadow_compat . .BR shadow_compat .
.SH FILES .SH FILES
@ -296,7 +290,7 @@ is implemented by a shared object library named
.IB libnss_SERVICE.so. X .IB libnss_SERVICE.so. X
that resides in that resides in
.IR /lib . .IR /lib .
.RS 3 .RS 4
.TP 25 .TP 25
.PD 0 .PD 0
.I /etc/nsswitch.conf .I /etc/nsswitch.conf
@ -324,9 +318,6 @@ implements "nis" source.
implements "nisplus" source. implements "nisplus" source.
.PD .PD
.RE .RE
.SH SEE ALSO
.BR getent (1),
.BR nss (5).
.SH NOTES .SH NOTES
Within each process that uses Within each process that uses
.BR nsswitch.conf , .BR nsswitch.conf ,
@ -334,16 +325,17 @@ the entire file is read only once.
If the file is later changed, the If the file is later changed, the
process will continue using the old configuration. process will continue using the old configuration.
.LP .LP
Traditionally there was only a single source for service information, Traditionally, there was only a single source for service information,
often in the form of a single configuration often in the form of a single configuration
file (e.g. \fI/etc/passwd\fP). file (e.g., \fI/etc/passwd\fP).
However, as other nameservices, like the Network Information However, as other name services, such as the Network Information
Service (NIS) and the Domain Name Service (DNS), became popular, Service (NIS) and the Domain Name Service (DNS), became popular,
a method was needed a method was needed
that would be more flexible than fixed search orders coded into that would be more flexible than fixed search orders coded into
the C library. the C library.
.LP The Names Server Switch mechanism
The Linux libc5 with NYS support and the GNU C Library 2.x (libc.so.6) (based on the mechanism used by Sun Microsystems in the Solaris 2 C library)
introduced a cleaner solution to the problem, based on the introduced a cleaner solution to the problem.
.B "Name Service Switch" .SH SEE ALSO
mechanism used by Sun Microsystems in the Solaris 2 C library. .BR getent (1),
.BR nss (5)