1 .\" Copyright (c) 1998, 1999 Thorsten Kukuk (kukuk@vt.uni-paderborn.de)
3 .\" This is free documentation; you can redistribute it and/or
4 .\" modify it under the terms of the GNU General Public License as
5 .\" published by the Free Software Foundation; either version 2 of
6 .\" the License, or (at your option) any later version.
8 .\" The GNU General Public License's references to "object code"
9 .\" and "executables" are to be interpreted as the output of any
10 .\" document formatting or typesetting system, including
11 .\" intermediate and printed output.
13 .\" This manual is distributed in the hope that it will be useful,
14 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
15 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 .\" GNU General Public License for more details.
18 .\" You should have received a copy of the GNU General Public
19 .\" License along with this manual; if not, write to the Free
20 .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
23 .\" This manual page based on the GNU C Library info pages.
24 .\" FIXME ? The use of quotes on this page is inconsistent with the
25 .\" rest of man-pages.
27 .TH NSSWITCH.CONF 5 1999-01-17 "Linux" "Linux Programmer's Manual"
29 nsswitch.conf \- System Databases and Name Service Switch configuration file
31 Various functions in the C Library need to be configured to work
32 correctly in the local environment.
33 Traditionally, this was done by
34 using files (e.g., \fI/etc/passwd\fP), but other nameservices (like the
35 Network Information Service (NIS) and the Domain Name Service (DNS))
36 became popular, and were hacked into the C library, usually with a fixed
39 The Linux libc5 with NYS support and the GNU C Library 2.x (libc.so.6)
40 contain a cleaner solution of this problem.
41 It is designed after a method
42 used by Sun Microsystems in the C library of Solaris 2.
44 name and call this scheme "Name Service Switch" (NSS).
46 the "databases" and their lookup order are specified in the
50 The following databases are available in the NSS:
61 Groups of users, used by
66 Host names and numbers, used by
68 and similar functions.
71 Network wide list of hosts and users, used for access rules.
72 C libraries before glibc 2.1 only support netgroups over NIS.
75 Network names and numbers, used by
80 User passwords, used by
85 Network protocols, used by
90 Public and secret keys for Secure_RPC used by NFS and NIS+.
93 Remote procedure call names and numbers, used by
95 and similar functions.
98 Network services, used by
103 Shadow user passwords, used by
107 .I /etc/nsswitch.conf
108 (namely, the default used when
109 .I /etc/nsswitch.conf
125 dns [!UNAVAIL=return] files
128 nis [NOTFOUND=return] files
131 nis [NOTFOUND=return] files
134 nis [NOTFOUND=return] files
137 nis [NOTFOUND=return] files
140 nis [NOTFOUND=return] files
143 The first column is the database.
144 The rest of the line specifies how the lookup process works.
145 You can specify the way it works for each database individually.
147 The configuration specification for each database can contain two
151 * The service specification like `files', `db', or `nis'.
153 * The reaction on lookup result like `[NOTFOUND=return]'.
156 For libc5 with NYS, the allowed service specifications are `files', `nis',
158 For hosts, you could specify `dns' as extra service, for
159 passwd and group `compat', but not for shadow.
161 For glibc, you must have a file called
162 .BI /lib/libnss_SERVICE.so. X
163 for every SERVICE you are using.
164 On a standard installation, you could use
165 `files', `db', `nis', and `nisplus'.
166 For hosts, you could specify `dns' as
167 extra service, for passwd, group, and shadow `compat'.
168 These services will not
169 be used by libc5 with NYS.
172 is 1 for glibc 2.0 and 2 for glibc 2.1.
174 The second item in the specification gives the user much finer
175 control on the lookup process.
176 Action items are placed between two
177 service names and are written within brackets.
180 `[' ( `!'? STATUS `=' ACTION )+ `]'
186 STATUS => success | notfound | unavail | tryagain
188 ACTION => return | continue
191 The case of the keywords is insignificant.
192 The STATUS values are
193 the results of a call to a lookup function of a specific service.
197 No error occurred and the wanted entry is returned.
199 action for this is `return'.
202 The lookup process succeeded, but the needed value was not found.
203 The default action is `continue'.
206 The service is permanently unavailable.
207 This can either mean the
208 needed file is not available, or, for DNS, the server is not
209 available or does not allow queries.
210 The default action is
214 The service is temporarily unavailable.
215 This could mean a file is
216 locked or a server currently cannot accept more connections.
217 The default action is `continue'.
218 .SS Interaction with +/\- syntax (compat mode)
219 Linux libc5 without NYS does not have the name service switch but does
220 allow the user some policy control.
223 you could have entries of the form +user or +@netgroup
224 (include the specified user from the NIS passwd map),
225 \-user or \-@netgroup (exclude the specified user),
226 and + (include every user, except the excluded ones, from the NIS
228 Since most people only put a + at the end of
230 to include everything from NIS, the switch provides a faster
231 alternative for this case (`passwd: files nis') which doesn't
232 require the single + entry in
237 If this is not sufficient, the NSS `compat' service provides full
239 By default, the source is `nis', but this may be
240 overridden by specifying `nisplus' as source for the pseudo-databases
245 These pseudo-databases are only available in GNU C Library.
247 A service named SERVICE is implemented by a shared object library named
248 .BI libnss_SERVICE.so. X
253 .I /etc/nsswitch.conf
256 .BI /lib/libnss_compat.so. X
257 implements `compat' source for glibc2
259 .BI /lib/libnss_db.so. X
260 implements `db' source for glibc2
262 .BI /lib/libnss_dns.so. X
263 implements `dns' source for glibc2
265 .BI /lib/libnss_files.so. X
266 implements `files' source for glibc2
268 .BI /lib/libnss_hesiod.so. X
269 implements `hesiod' source for glibc2
271 .BI /lib/libnss_nis.so. X
272 implements `nis' source for glibc2
274 .I /lib/libnss_nisplus.so.2
275 implements `nisplus' source for glibc 2.1
278 Within each process that uses
280 the entire file is read only once; if the file is later changed, the
281 process will continue using the old configuration.
283 With Solaris, it isn't possible to link programs using the NSS Service
285 With Linux, this is no problem.