1 .\" Copyright (c) 1998, 1999 Thorsten Kukuk (kukuk@vt.uni-paderborn.de)
2 .\" Copyright (c) 2011, Mark R. Bannister <cambridge@users.sourceforge.net>
4 .\" %%%LICENSE_START(GPLv2+_DOC_FULL)
5 .\" This is free documentation; you can redistribute it and/or
6 .\" modify it under the terms of the GNU General Public License as
7 .\" published by the Free Software Foundation; either version 2 of
8 .\" the License, or (at your option) any later version.
10 .\" The GNU General Public License's references to "object code"
11 .\" and "executables" are to be interpreted as the output of any
12 .\" document formatting or typesetting system, including
13 .\" intermediate and printed output.
15 .\" This manual is distributed in the hope that it will be useful,
16 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
17 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 .\" GNU General Public License for more details.
20 .\" You should have received a copy of the GNU General Public
21 .\" License along with this manual; if not, see
22 .\" <http://www.gnu.org/licenses/>.
25 .TH NSSWITCH.CONF 5 2013-02-12 "Linux" "Linux Programmer's Manual"
27 nsswitch.conf \- Name Service Switch configuration file
29 The Name Service Switch (NSS) configuration file,
30 .IR /etc/nsswitch.conf ,
31 is used by the GNU C Library to determine
32 the sources from which to obtain name-service information in
33 a range of categories,
35 Each category of information is identified by a database name.
37 The file is plain ASCII text, with columns separated by spaces or tab
39 The first column specifies the database name.
40 The remaining columns describe the order of sources to query and a
41 limited set of actions that can be performed by lookup result.
43 The following databases are understood by the GNU C Library:
48 and related functions.
54 Groups of users, used by
56 and related functions.
59 Host names and numbers, used by
61 and related functions.
64 Supplementary group access list, used by
69 Network-wide list of hosts and users, used for access rules.
70 C libraries before glibc 2.1 supported netgroups only over NIS.
73 Network names and numbers, used by
75 and related functions.
78 User passwords, used by
80 and related functions.
83 Network protocols, used by
85 and related functions.
88 Public and secret keys for Secure_RPC used by NFS and NIS+.
91 Remote procedure call names and numbers, used by
93 and related functions.
96 Network services, used by
98 and related functions.
101 Shadow user passwords, used by
103 and related functions.
106 .I /etc/nsswitch.conf
123 dns [!UNAVAIL=return] files
126 nis [NOTFOUND=return] files
129 nis [NOTFOUND=return] files
132 nis [NOTFOUND=return] files
135 nis [NOTFOUND=return] files
138 nis [NOTFOUND=return] files
142 The first column is the database name.
143 The remaining columns specify:
145 One or more service specifications, for example, "files", "db", or "nis".
146 The order of the services on the line determines the order in which
147 those services will be queried, in turn, until a result is found.
149 Optional actions to perform if a particular result is obtained
150 from the preceding service, for example, "[NOTFOUND=return]".
152 The service specifications supported on your system depend on the
153 presence of shared libraries, and are therefore extensible.
155 .IB /lib/libnss_SERVICE.so. X
156 will provide the named
158 On a standard installation, you can use
159 "files", "db", "nis", and "nisplus".
162 database, you can additionally specify "dns".
168 databases, you can additionally specify
170 .B "Compatibility mode"
174 may be 1 for glibc 2.0, or 2 for glibc 2.1 and later.
175 On systems with additional libraries installed, you may have access to
176 further services such as "hesiod", "ldap", "winbind" and "wins".
178 An action may also be specified following a service specification.
179 The action modifies the behavior following a result obtained
180 from the preceding data source.
181 Action items take the general form:
184 .RI [ STATUS = ACTION ]
186 .RI [! STATUS = ACTION ]
209 The ! negates the test, matching all possible results except the
211 The case of the keywords is not significant.
215 value is matched against the result of the lookup function called by
216 the preceding service specification, and can be one of:
220 No error occurred and the requested entry is returned.
221 The default action for this condition is "return".
224 The lookup succeeded, but the requested entry was not found.
225 The default action for this condition is "continue".
228 The service is permanently unavailable.
229 This can mean either that the
230 required file cannot be read, or, for network services, that the server
231 is not available or does not allow queries.
232 The default action for this condition is "continue".
235 The service is temporarily unavailable.
236 This could mean a file is
237 locked or a server currently cannot accept more connections.
238 The default action for this condition is "continue".
248 Do not call any further lookup functions.
249 However, for compatibility reasons, if this is the selected action for the
253 status, and the configuration file does not contain the
255 line, the next lookup function is always called,
256 without affecting the search result.
259 Call the next lookup function.
261 .SS Compatibility mode (compat)
262 The NSS "compat" service is similar to "files" except that it
263 additionally permits special entries in
265 for granting users or members of netgroups access to the system.
266 The following entries are valid in this mode:
270 Include the specified
272 from the NIS passwd map.
275 Include all users in the given
279 Exclude the specified
281 from the NIS passwd map.
284 Exclude all users in the given
288 Include every user, except previously excluded ones, from the
292 By default the source is "nis", but this may be
293 overridden by specifying "nisplus" as the source for the pseudo-databases
301 is implemented by a shared object library named
302 .IB libnss_SERVICE.so. X
308 .I /etc/nsswitch.conf
309 NSS configuration file.
311 .IB /lib/libnss_compat.so. X
312 implements "compat" source.
314 .IB /lib/libnss_db.so. X
315 implements "db" source.
317 .IB /lib/libnss_dns.so. X
318 implements "dns" source.
320 .IB /lib/libnss_files.so. X
321 implements "files" source.
323 .IB /lib/libnss_hesiod.so. X
324 implements "hesiod" source.
326 .IB /lib/libnss_nis.so. X
327 implements "nis" source.
329 .IB /lib/libnss_nisplus.so. X
330 implements "nisplus" source.
334 Within each process that uses
336 the entire file is read only once.
337 If the file is later changed, the
338 process will continue using the old configuration.
340 Traditionally, there was only a single source for service information,
341 often in the form of a single configuration
342 file (e.g., \fI/etc/passwd\fP).
343 However, as other name services, such as the Network Information
344 Service (NIS) and the Domain Name Service (DNS), became popular,
346 that would be more flexible than fixed search orders coded into
348 The Name Service Switch mechanism,
349 which was based on the mechanism used by
350 Sun Microsystems in the Solaris 2 C library,
351 introduced a cleaner solution to the problem.
356 This page is part of release 3.68 of the Linux
359 A description of the project,
360 information about reporting bugs,
361 and the latest version of this page,
363 \%http://www.kernel.org/doc/man\-pages/.