OSDN Git Service

06439f2f2e05e495ccd1bedda1b41f9dfe6edf9d
[linuxjm/LDP_man-pages.git] / draft / man5 / nsswitch.conf.5
1 .\" Copyright (c) 1998 Thorsten Kukuk (kukuk@vt.uni-paderborn.de)
2 .\"
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.
7 .\"
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.
12 .\"
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.
17 .\"
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., 675 Mass Ave, Cambridge, MA 02139,
21 .\" USA.
22 .\"
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.
26 .\"
27 .\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved.
28 .\" Translated Wed Apr 29 1998 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
29 .\" Updated & Modified Sat Aug 21 1999
30 .\"       by NAKANO Takeo <nakano@apm.seikei.ac.jp>
31 .\" Updated Fri Oct 12 JST 2001 by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
32 .\"
33 .\" WORD:       lookup          閲覧(する)
34 .\"
35 .TH NSSWITCH.CONF 5 1999-01-17 "Linux" "Linux Programmer's Manual"
36 .\"O .SH NAME
37 .\"O nsswitch.conf \- System Databases and Name Service Switch configuration file
38 .SH 名前
39 nsswitch.conf \- システムデータベースとネームサービススイッチの設定ファイル
40 .\"O .SH DESCRIPTION
41 .SH 説明
42 .\"O Various functions in the C Library need to be configured to work
43 .\"O correctly in the local environment.
44 .\"O Traditionally, this was done by
45 .\"O using files (e.g., \fI/etc/passwd\fP), but other nameservices (like the
46 .\"O Network Information Service (NIS) and the Domain Name Service (DNS))
47 .\"O became popular, and were hacked into the C library, usually with a fixed
48 .\"O search order.
49 C ライブラリの機能の中には、ローカルな環境で正しく動作させるには設定が
50 必要なものが多数存在する。伝統的にこれはファイル (例えば \fI/etc/passwd\fP) を
51 用いることで実現されてきた。しかし他のネームサービス (Network
52 Information Service (NIS) や Domain Name Service (DNS)) が一般的になり、
53 これらが C ライブラリに取り込まれるようになっていった。ただし通常、検
54 索の順序は固定されていた。
55 .LP
56 .\"O The Linux libc5 with NYS support and the GNU C Library 2.x (libc.so.6)
57 .\"O contain a cleaner solution of this problem.
58 .\"O It is designed after a method
59 .\"O used by Sun Microsystems in the C library of Solaris 2.
60 .\"O We follow their
61 .\"O name and call this scheme "Name Service Switch" (NSS).
62 .\"O The sources for
63 .\"O the "databases" and their lookup order are specified in the
64 .\"O .I /etc/nsswitch.conf
65 .\"O file.
66 NYS をサポートした Linux libc5 や GNU C Linrary 2.x (libc.so.6) では、
67 この問題はより見通し良く解決できるようになっている。これらは Sun
68 Microsystems が Solaris 2 の C ライブラリで用いた方法にならっている。
69 以下ではこの仕組みを "Name Service Switch" (NSS) と呼ぶ。データベース
70 の情報源と、それらを閲覧する順序を指定したのが
71 .I /etc/nsswitch.conf
72 ファイルである。
73 .LP
74 .\"O The following databases are available in the NSS:
75 NSS(ネームサービススィッチ) では以下のデータベースを扱うことができる。
76 .TP
77 .B aliases
78 .\"O Mail aliases, used by
79 .\"O .BR sendmail (8).
80 .\"O Presently ignored.
81 .BR sendmail (8)
82 で用いられるメールエイリアス。
83 現在は無視される。
84 .TP
85 .B ethers
86 .\"O Ethernet numbers.
87 イーサーネット番号。
88 .TP
89 .B group
90 .\"O Groups of users, used by
91 .\"O .BR getgrent (3)
92 .\"O functions.
93 ユーザーのグループ。
94 .BR getgrent (3)
95 関数によって用いられる。
96 .TP
97 .B hosts
98 .\"O Host names and numbers, used by
99 .\"O .BR gethostbyname (3)
100 .\"O and similar functions.
101 ホスト名とホスト番号。
102 .BR gethostbyname (3)
103 などの関数によって用いられる。
104 .TP
105 .B netgroup
106 .\"O Network wide list of hosts and users, used for access rules.
107 .\"O C libraries before glibc 2.1 only support netgroups over NIS.
108 ネットワークワイドに用いられるホストやユーザーのリスト。アクセス制限に
109 利用される。 glibc 2.1 以前の C ライブラリは、 NIS 上でだけ
110 netgroup をサポートしている。
111 .TP
112 .B networks
113 .\"O Network names and numbers, used by
114 .\"O .BR getnetent (3)
115 .\"O functions.
116 ネットワーク名と番号。
117 .BR getnetent (3)
118 関数によって用いられる。
119 .TP
120 .B passwd
121 .\"O User passwords, used by
122 .\"O .BR getpwent (3)
123 .\"O functions.
124 ユーザーパスワード。
125 .BR getpwent (3)
126 関数によって用いられる。
127 .TP
128 .B protocols
129 .\"O Network protocols, used by
130 .\"O .BR getprotoent (3)
131 .\"O functions.
132 ネットワークプロトコル。
133 .BR getprotoent (3)
134 関数によって用いられる。
135 .TP
136 .B publickey
137 .\"O Public and secret keys for secure_rpc used by NIS+ and NFS.
138 NIS+ と NFS によって用いられる secure_rpc の公開鍵と秘密鍵。
139 .TP
140 .B rpc
141 .\"O Remote procedure call names and numbers, used by
142 .\"O .BR getrpcbyname (3)
143 .\"O and similar functions.
144 リモートプロシジャーコール (remote procedure call) の名前と番号。
145 .BR getrpcbyname (3)
146 などの関数によって用いられる。
147 .TP
148 .B services
149 .\"O Network services, used by
150 .\"O .BR getservent (3)
151 .\"O functions.
152 ネットワークサービス。
153 .BR getservent (3)
154 関数によって用いられる。
155 .TP
156 .B shadow
157 .\"O Shadow user passwords, used by
158 .\"O .BR getspnam (3).
159 シャドウユーザーパスワード。
160 .BR getspnam (3)
161 によって用いられる。
162 .LP
163 .\"O An example
164 .\"O .I /etc/nsswitch.conf
165 .\"O (namely, the default used when
166 .\"O .I /etc/nsswitch.conf
167 .\"O is missing):
168 .I /etc/nsswitch.conf
169 ファイルの一例を以下に示す (ここに示す内容は
170 .I /etc/nsswitch.conf
171 ファイルがない場合のデフォルトと同じである)。
172 .sp 1n
173 .PD 0
174 .TP 16
175 passwd:
176 compat
177 .TP
178 group:
179 compat
180 .TP
181 shadow:
182 compat
183 .sp 1n
184 .TP
185 hosts:
186 dns [!UNAVAIL=return] files
187 .TP
188 networks:
189 nis [NOTFOUND=return] files
190 .TP
191 ethers:
192 nis [NOTFOUND=return] files
193 .TP
194 protocols:
195 nis [NOTFOUND=return] files
196 .TP
197 rpc:
198 nis [NOTFOUND=return] files
199 .TP
200 services:
201 nis [NOTFOUND=return] files
202 .PD
203 .LP
204 .\"O XXX: The first column is the database.
205 .\"O XXX: The rest of the line specifies how the lookup process works.
206 .\"O You can specify the way it works for each database individually.
207 最初のカラムはデータベース名である。
208 行の残りでは閲覧プロセスの動作を指定している。
209 それぞれのデータベースに対して、閲覧方法は独立に設定できる。
210 .LP
211 .\"O The configuration specification for each database can contain two
212 .\"O different items:
213 各々のデータベースの設定には以下の 2 種類の内容を指定することができる。
214 .PD 0
215 .TP
216 .\"O * The service specification like `files', `db', or `nis'.
217 * サービスの指定。 `files', `db', `nis' など。
218 .TP
219 .\"O * The reaction on lookup result like `[NOTFOUND=return]'.
220 * 閲覧結果に対するリアクション。 `[NOTFOUND=return]' など。
221 .PD
222 .LP
223 .\"O For libc5 with NYS, the allowed service specifications are `files', `nis',
224 .\"O and `nisplus'.
225 .\"O For hosts, you could specify `dns' as extra service, for
226 .\"O passwd and group `compat', but not for shadow.
227 NYS 機能を組み込んだ libc5 では、指定できるサービスは `files'、 `nis'、
228 `nisplus' のいずれかである。 hosts に対しては `dns' も指定できる。また
229 passwd と group に対しては `compat' も指定できる。 shadow には
230 `compat' の指定はできない。
231 .LP
232 .\"O For glibc, you must have a file called
233 .\"O .BI /lib/libnss_SERVICE.so. X
234 .\"O for every SERVICE you are using.
235 .\"O On a standard installation, you could use
236 .\"O `files', `db', `nis', and `nisplus'.
237 .\"O For hosts, you could specify `dns' as
238 .\"O extra service, for passwd, group, and shadow `compat'.
239 .\"O These services will not
240 .\"O be used by libc5 with NYS.
241 .\"O The version number
242 .\"O .I X
243 .\"O is 1 for glibc 2.0 and 2 for glibc 2.1.
244 glibc では、利用しようとするサービス SERVICE それぞれに対し
245
246 .BI /lib/libnss_SERVICE.so. X
247 というファイルが必要になる。標準的なインストールでは `files'、 `db'、
248 `nis'、 `nisplus' が利用できるようになっていることが多い。 hosts に対
249 しては `dns' も指定でき、 passwd、 group、 shadow に対しては `compat'
250 も指定できる。
251 これらのサービスは libc5+NYS の環境では利用できない。
252 バージョン番号
253 .I X
254 は、 glibc 2.0 用なら 1、 glibc 2.1 用なら 2 である。
255 .LP
256 .\"O The second item in the specification gives the user much finer
257 .\"O control on the lookup process.
258 .\"O Action items are placed between two
259 .\"O service names and are written within brackets.
260 .\"O The general form is
261 二つめの指定方法は閲覧プロセスをより詳細に制御するためのものである。ア
262 クション指定 (action item) はサービス名の間に、角かっこ [] で括られて
263 記述される。一般的な書式は以下の通り。
264 .LP
265 `[' ( `!'? STATUS `=' ACTION )+ `]'
266 .LP
267 .\"O where
268 ここでそれぞれ
269 .sp 1n
270 .PD 0
271 .TP
272 STATUS => success | notfound | unavail | tryagain
273 .TP
274 ACTION => return | continue
275 .PD
276 である。
277 .LP
278 .\"O The case of the keywords is insignificant.
279 .\"O The STATUS values are
280 .\"O the results of a call to a lookup function of a specific service.
281 .\"O They mean:
282 キーワードの大文字小文字は区別されない。 STATUS の値は特定の機能に対し
283 て閲覧を行った結果である。それぞれの意味は以下の通り。
284 .TP
285 .B success
286 .\"O No error occurred and the wanted entry is returned.
287 .\"O The default
288 .\"O action for this is `return'.
289 エラーは起こらず、必要なエントリが返された。この結果に対するデフォルト
290 のアクションは `return' である。
291 .TP
292 .B notfound
293 .\"O The lookup process succeeded, but the needed value was not found.
294 .\"O The default action is `continue'.
295 閲覧プロセスは成功したが、必要な値が見つからなかった。デフォルトの
296 アクションは `continue'。
297 .TP
298 .B unavail
299 .\"O The service is permanently unavailable.
300 .\"O This can either mean the
301 .\"O needed file is not available, or, for DNS, the server is not
302 .\"O available or does not allow queries.
303 .\"O The default action is
304 .\"O `continue'.
305 サービスが(永続的に)利用できない。必要なファイルが存在しない、DNS の
306 場合にはサーバに対する問い合わせが許可されていない、などがありうる。
307 デフォルトのアクションは `continue'。
308 .TP
309 .B tryagain
310 .\"O The service is temporarily unavailable.
311 .\"O This could mean a file is
312 .\"O locked or a server currently cannot accept more connections.
313 .\"O The default action is `continue'.
314 サービスが一時的に利用できない。ファイルがロックされている、サーバの接
315 続数がリミットを越えていて現在利用できない、などが考えられる。デフォル
316 トのアクションは `continue'。
317 .\"O .SS Interaction with +/\- syntax (compat mode)
318 .SS +/\- 書式との関係 (compat モード)
319 .\"O Linux libc5 without NYS does not has the name service switch but does
320 .\"O allow the user some policy control.
321 .\"O In
322 .\"O .I /etc/passwd
323 .\"O you could have entries of the form +user or +@netgroup
324 .\"O (include the specified user from the NIS passwd map),
325 .\"O \-user or \-@netgroup (exclude the specified user),
326 .\"O and + (include every user, except the excluded ones, from the NIS
327 .\"O passwd map).
328 .\"O Since most people only put a + at the end of
329 .\"O .I /etc/passwd
330 .\"O to include everything from NIS, the switch provides a faster
331 .\"O alternative for this case (`passwd: files nis') which doesn't
332 .\"O require the single + entry in
333 .\"O .IR /etc/passwd ,
334 .\"O .I /etc/group ,
335 .\"O and
336 .\"O .IR /etc/shadow .
337 NYS 機能を組み込んでいない libc5 は、ネームサービススイッチの機能を持っ
338 ていない。しかしある程度のポリシー制御は行うことができる。
339 .I /etc/passwd
340 では +user や +@netgroup (NIS の passwd マップから指定したユーザを取り込
341 む)、 \-user や \-@netgroup (指定したユーザを除外する)、 + (NIS の
342 passwd マップから、除外されたユーザ以外の全てのエントリを取り込む) な
343 どを指定することができる。
344 ほとんどの場合は
345 .I /etc/passwd
346 の最後に + を付けて NIS のすべてを取り込んでいるだけなので、
347 ネームサービススイッチを用いて
348 (`passwd: files nis') のようにすればより高速な動作が期待でき、
349 また
350 .IR /etc/passwd ", " /etc/group ", " /etc/shadow
351 に + だけのエントリを書かなくてすむ。
352 .\"O If this is not sufficient, the NSS `compat' service provides full
353 .\"O +/\- semantics.
354 .\"O By default, the source is `nis', but this may be
355 .\"O overridden by specifying `nisplus' as source for the pseudo-databases
356 .\"O .BR passwd_compat ,
357 .\"O .B group_compat
358 .\"O and
359 .\"O .BR shadow_compat .
360 .\"O These pseudo-databases are only available in GNU C Library.
361 より細かな制御を行いたい場合は、 NSS の `compat' サービスを用いれば
362 +/\- 書式をフルに用いることができる。デフォルトではソースは `nis' になっ
363 ているが、これは擬似データベース
364 .BR passwd_compat , group_compat , shadow_compat
365 などに `nisplus' を指定することで上書きできる。
366 これらの擬似データベースは GNU C ライブラリでしか利用できない。
367 .\"O .SH FILES
368 .SH ファイル
369 .\"O A service named SERVICE is implemented by a shared object library
370 .\"O named libnss_SERVICE.so.1 that resides in /lib.
371 SERVICE という名前のサービスは libnss_SERVICE.so.1 という名前の共有オ
372 ブジェクトライブラリで実装されている。これは /lib に置かれる。
373 .TP 25
374 .PD 0
375 .I /etc/nsswitch.conf
376 .\"O configuration file
377 設定ファイル。
378 .TP
379 .BI /lib/libnss_compat.so. X
380 .\"O implements `compat' source for glibc2
381 glibc2 に対して `compat' ソースを実装したもの。
382 .TP
383 .BI /lib/libnss_db.so. X
384 .\"O implements `db' source for glibc2
385 glibc2 に対して `db' ソースを実装したもの。
386 .TP
387 .BI /lib/libnss_dns.so. X
388 .\"O implements `dns' source for glibc2
389 glibc2 に対して `dns' ソースを実装したもの。
390 .TP
391 .BI /lib/libnss_files.so. X
392 .\"O implements `files' source for glibc2
393 glibc2 に対して `files' ソースを実装したもの。
394 .TP
395 .BI /lib/libnss_hesoid.so. X
396 .\"O implements `hesoid' source for glibc2
397 glibc2 に対して `hesoid' ソースを実装したもの。
398 .TP
399 .BI /lib/libnss_nis.so. X
400 .\"O implements `nis' source for glibc2
401 glibc2 に対して `nis' ソースを実装したもの。
402 .TP
403 .BI /lib/libnss_nisplus.so. X
404 .\"O implements `nisplus' source for glibc2
405 glibc2 に対して `nisplus' ソースを実装したもの。
406 .TP
407 .I /lib/libnss_nisplus.so.2
408 .\"O implements `nisplus' source for glibc 2.1
409 glibc 2.1 に対して `nisplus' ソースを実装したもの。
410 .PD
411 .\"O .SH NOTES
412 .SH 注意
413 .\"O Within each process that uses
414 .\"O .BR nsswitch.conf ,
415 .\"O the entire file is read only once; if the file is later changed, the
416 .\"O process will continue using the old configuration.
417 .I nsswitch.conf
418 を利用するそれぞれのプロセスでは、ファイルは一度しか読み込まれない。
419 もし nsswitch.conf があとで書き換えられても、
420 そのプロセスは古い設定のままで動作を継続する。
421 .LP
422 .\"O With Solaris, it isn't possible to link programs using the NSS Service
423 .\"O statically.
424 .\"O With Linux, this is no problem.
425 Solaris では NSS サービスを用いたプログラムをスタティックにリンクする
426 ことはできない。 Linux では問題なくスタティックリンクできる。