.\" Copyright (c) 1998 Thorsten Kukuk (kukuk@vt.uni-paderborn.de) .\" .\" This is free documentation; you can redistribute it and/or .\" modify it under the terms of the GNU General Public License as .\" published by the Free Software Foundation; either version 2 of .\" the License, or (at your option) any later version. .\" .\" The GNU General Public License's references to "object code" .\" and "executables" are to be interpreted as the output of any .\" document formatting or typesetting system, including .\" intermediate and printed output. .\" .\" This manual is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public .\" License along with this manual; if not, write to the Free .\" Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, .\" USA. .\" .\" This manual page based on the GNU C Library info pages. .\" FIXME ? The use of quotes on this page is inconsistent with the .\" rest of man-pages. .\" .\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved. .\" Translated Wed Apr 29 1998 by NAKANO Takeo .\" Updated & Modified Sat Aug 21 1999 .\" by NAKANO Takeo .\" Updated Fri Oct 12 JST 2001 by Akihiro MOTOKI .\" .\" WORD: lookup 閲覧(する) .\" .TH NSSWITCH.CONF 5 1999-01-17 "Linux" "Linux Programmer's Manual" .\"O .SH NAME .\"O nsswitch.conf \- System Databases and Name Service Switch configuration file .SH 名前 nsswitch.conf \- システムデータベースとネームサービススイッチの設定ファイル .\"O .SH DESCRIPTION .SH 説明 .\"O Various functions in the C Library need to be configured to work .\"O correctly in the local environment. .\"O Traditionally, this was done by .\"O using files (e.g., \fI/etc/passwd\fP), but other nameservices (like the .\"O Network Information Service (NIS) and the Domain Name Service (DNS)) .\"O became popular, and were hacked into the C library, usually with a fixed .\"O search order. C ライブラリの機能の中には、ローカルな環境で正しく動作させるには設定が 必要なものが多数存在する。伝統的にこれはファイル (例えば \fI/etc/passwd\fP) を 用いることで実現されてきた。しかし他のネームサービス (Network Information Service (NIS) や Domain Name Service (DNS)) が一般的になり、 これらが C ライブラリに取り込まれるようになっていった。ただし通常、検 索の順序は固定されていた。 .LP .\"O The Linux libc5 with NYS support and the GNU C Library 2.x (libc.so.6) .\"O contain a cleaner solution of this problem. .\"O It is designed after a method .\"O used by Sun Microsystems in the C library of Solaris 2. .\"O We follow their .\"O name and call this scheme "Name Service Switch" (NSS). .\"O The sources for .\"O the "databases" and their lookup order are specified in the .\"O .I /etc/nsswitch.conf .\"O file. NYS をサポートした Linux libc5 や GNU C Linrary 2.x (libc.so.6) では、 この問題はより見通し良く解決できるようになっている。これらは Sun Microsystems が Solaris 2 の C ライブラリで用いた方法にならっている。 以下ではこの仕組みを "Name Service Switch" (NSS) と呼ぶ。データベース の情報源と、それらを閲覧する順序を指定したのが .I /etc/nsswitch.conf ファイルである。 .LP .\"O The following databases are available in the NSS: NSS(ネームサービススィッチ) では以下のデータベースを扱うことができる。 .TP .B aliases .\"O Mail aliases, used by .\"O .BR sendmail (8). .\"O Presently ignored. .BR sendmail (8) で用いられるメールエイリアス。 現在は無視される。 .TP .B ethers .\"O Ethernet numbers. イーサーネット番号。 .TP .B group .\"O Groups of users, used by .\"O .BR getgrent (3) .\"O functions. ユーザーのグループ。 .BR getgrent (3) 関数によって用いられる。 .TP .B hosts .\"O Host names and numbers, used by .\"O .BR gethostbyname (3) .\"O and similar functions. ホスト名とホスト番号。 .BR gethostbyname (3) などの関数によって用いられる。 .TP .B netgroup .\"O Network wide list of hosts and users, used for access rules. .\"O C libraries before glibc 2.1 only support netgroups over NIS. ネットワークワイドに用いられるホストやユーザーのリスト。アクセス制限に 利用される。 glibc 2.1 以前の C ライブラリは、 NIS 上でだけ netgroup をサポートしている。 .TP .B networks .\"O Network names and numbers, used by .\"O .BR getnetent (3) .\"O functions. ネットワーク名と番号。 .BR getnetent (3) 関数によって用いられる。 .TP .B passwd .\"O User passwords, used by .\"O .BR getpwent (3) .\"O functions. ユーザーパスワード。 .BR getpwent (3) 関数によって用いられる。 .TP .B protocols .\"O Network protocols, used by .\"O .BR getprotoent (3) .\"O functions. ネットワークプロトコル。 .BR getprotoent (3) 関数によって用いられる。 .TP .B publickey .\"O Public and secret keys for secure_rpc used by NIS+ and NFS. NIS+ と NFS によって用いられる secure_rpc の公開鍵と秘密鍵。 .TP .B rpc .\"O Remote procedure call names and numbers, used by .\"O .BR getrpcbyname (3) .\"O and similar functions. リモートプロシジャーコール (remote procedure call) の名前と番号。 .BR getrpcbyname (3) などの関数によって用いられる。 .TP .B services .\"O Network services, used by .\"O .BR getservent (3) .\"O functions. ネットワークサービス。 .BR getservent (3) 関数によって用いられる。 .TP .B shadow .\"O Shadow user passwords, used by .\"O .BR getspnam (3). シャドウユーザーパスワード。 .BR getspnam (3) によって用いられる。 .LP .\"O An example .\"O .I /etc/nsswitch.conf .\"O (namely, the default used when .\"O .I /etc/nsswitch.conf .\"O is missing): .I /etc/nsswitch.conf ファイルの一例を以下に示す (ここに示す内容は .I /etc/nsswitch.conf ファイルがない場合のデフォルトと同じである)。 .sp 1n .PD 0 .TP 16 passwd: compat .TP group: compat .TP shadow: compat .sp 1n .TP hosts: dns [!UNAVAIL=return] files .TP networks: nis [NOTFOUND=return] files .TP ethers: nis [NOTFOUND=return] files .TP protocols: nis [NOTFOUND=return] files .TP rpc: nis [NOTFOUND=return] files .TP services: nis [NOTFOUND=return] files .PD .LP .\"O XXX: The first column is the database. .\"O XXX: The rest of the line specifies how the lookup process works. .\"O You can specify the way it works for each database individually. 最初のカラムはデータベース名である。 行の残りでは閲覧プロセスの動作を指定している。 それぞれのデータベースに対して、閲覧方法は独立に設定できる。 .LP .\"O The configuration specification for each database can contain two .\"O different items: 各々のデータベースの設定には以下の 2 種類の内容を指定することができる。 .PD 0 .TP .\"O * The service specification like `files', `db', or `nis'. * サービスの指定。 `files', `db', `nis' など。 .TP .\"O * The reaction on lookup result like `[NOTFOUND=return]'. * 閲覧結果に対するリアクション。 `[NOTFOUND=return]' など。 .PD .LP .\"O For libc5 with NYS, the allowed service specifications are `files', `nis', .\"O and `nisplus'. .\"O For hosts, you could specify `dns' as extra service, for .\"O passwd and group `compat', but not for shadow. NYS 機能を組み込んだ libc5 では、指定できるサービスは `files'、 `nis'、 `nisplus' のいずれかである。 hosts に対しては `dns' も指定できる。また passwd と group に対しては `compat' も指定できる。 shadow には `compat' の指定はできない。 .LP .\"O For glibc, you must have a file called .\"O .BI /lib/libnss_SERVICE.so. X .\"O for every SERVICE you are using. .\"O On a standard installation, you could use .\"O `files', `db', `nis', and `nisplus'. .\"O For hosts, you could specify `dns' as .\"O extra service, for passwd, group, and shadow `compat'. .\"O These services will not .\"O be used by libc5 with NYS. .\"O The version number .\"O .I X .\"O is 1 for glibc 2.0 and 2 for glibc 2.1. glibc では、利用しようとするサービス SERVICE それぞれに対し て .BI /lib/libnss_SERVICE.so. X というファイルが必要になる。標準的なインストールでは `files'、 `db'、 `nis'、 `nisplus' が利用できるようになっていることが多い。 hosts に対 しては `dns' も指定でき、 passwd、 group、 shadow に対しては `compat' も指定できる。 これらのサービスは libc5+NYS の環境では利用できない。 バージョン番号 .I X は、 glibc 2.0 用なら 1、 glibc 2.1 用なら 2 である。 .LP .\"O The second item in the specification gives the user much finer .\"O control on the lookup process. .\"O Action items are placed between two .\"O service names and are written within brackets. .\"O The general form is 二つめの指定方法は閲覧プロセスをより詳細に制御するためのものである。ア クション指定 (action item) はサービス名の間に、角かっこ [] で括られて 記述される。一般的な書式は以下の通り。 .LP `[' ( `!'? STATUS `=' ACTION )+ `]' .LP .\"O where ここでそれぞれ .sp 1n .PD 0 .TP STATUS => success | notfound | unavail | tryagain .TP ACTION => return | continue .PD である。 .LP .\"O The case of the keywords is insignificant. .\"O The STATUS values are .\"O the results of a call to a lookup function of a specific service. .\"O They mean: キーワードの大文字小文字は区別されない。 STATUS の値は特定の機能に対し て閲覧を行った結果である。それぞれの意味は以下の通り。 .TP .B success .\"O No error occurred and the wanted entry is returned. .\"O The default .\"O action for this is `return'. エラーは起こらず、必要なエントリが返された。この結果に対するデフォルト のアクションは `return' である。 .TP .B notfound .\"O The lookup process works ok but the needed value was not found. .\"O The default action is `continue'. 閲覧プロセスは機能しているが、必要な値が見つからなかった。デフォルトの アクションは `continue'。 .TP .B unavail .\"O The service is permanently unavailable. .\"O This can either mean the .\"O needed file is not available, or, for DNS, the server is not .\"O available or does not allow queries. .\"O The default action is .\"O `continue'. サービスが(永続的に)利用できない。必要なファイルが存在しない、DNS の 場合にはサーバに対する問い合わせが許可されていない、などがありうる。 デフォルトのアクションは `continue'。 .TP .B tryagain .\"O The service is temporarily unavailable. .\"O This could mean a file is .\"O locked or a server currently cannot accept more connections. .\"O The default action is `continue'. サービスが一時的に利用できない。ファイルがロックされている、サーバの接 続数がリミットを越えていて現在利用できない、などが考えられる。デフォル トのアクションは `continue'。 .\"O .SS Interaction with +/\- syntax (compat mode) .SS +/\- 書式との関係 (compat モード) .\"O Linux libc5 without NYS does not has the name service switch but does .\"O allow the user some policy control. .\"O In .\"O .I /etc/passwd .\"O you could have entries of the form +user or +@netgroup .\"O (include the specified user from the NIS passwd map), .\"O \-user or \-@netgroup (exclude the specified user), .\"O and + (include every user, except the excluded ones, from the NIS .\"O passwd map). .\"O Since most people only put a + at the end of .\"O .I /etc/passwd .\"O to include everything from NIS, the switch provides a faster .\"O alternative for this case (`passwd: files nis') which doesn't .\"O require the single + entry in .\"O .IR /etc/passwd , .\"O .I /etc/group , .\"O and .\"O .IR /etc/shadow . NYS 機能を組み込んでいない libc5 は、ネームサービススイッチの機能を持っ ていない。しかしある程度のポリシー制御は行うことができる。 .I /etc/passwd では +user や +@netgroup (NIS の passwd マップから指定したユーザを取り込 む)、 \-user や \-@netgroup (指定したユーザを除外する)、 + (NIS の passwd マップから、除外されたユーザ以外の全てのエントリを取り込む) な どを指定することができる。 ほとんどの場合は .I /etc/passwd の最後に + を付けて NIS のすべてを取り込んでいるだけなので、 ネームサービススイッチを用いて (`passwd: files nis') のようにすればより高速な動作が期待でき、 また .IR /etc/passwd ", " /etc/group ", " /etc/shadow に + だけのエントリを書かなくてすむ。 .\"O If this is not sufficient, the NSS `compat' service provides full .\"O +/\- semantics. .\"O By default, the source is `nis', but this may be .\"O overridden by specifying `nisplus' as source for the pseudo-databases .\"O .BR passwd_compat , .\"O .B group_compat .\"O and .\"O .BR shadow_compat . .\"O These pseudo-databases are only available in GNU C Library. より細かな制御を行いたい場合は、 NSS の `compat' サービスを用いれば +/\- 書式をフルに用いることができる。デフォルトではソースは `nis' になっ ているが、これは擬似データベース .BR passwd_compat , group_compat , shadow_compat などに `nisplus' を指定することで上書きできる。 これらの擬似データベースは GNU C ライブラリでしか利用できない。 .\"O .SH FILES .SH ファイル .\"O A service named SERVICE is implemented by a shared object library .\"O named libnss_SERVICE.so.1 that resides in /lib. SERVICE という名前のサービスは libnss_SERVICE.so.1 という名前の共有オ ブジェクトライブラリで実装されている。これは /lib に置かれる。 .TP 25 .PD 0 .I /etc/nsswitch.conf .\"O configuration file 設定ファイル。 .TP .BI /lib/libnss_compat.so. X .\"O implements `compat' source for glibc2 glibc2 に対して `compat' ソースを実装したもの。 .TP .BI /lib/libnss_db.so. X .\"O implements `db' source for glibc2 glibc2 に対して `db' ソースを実装したもの。 .TP .BI /lib/libnss_dns.so. X .\"O implements `dns' source for glibc2 glibc2 に対して `dns' ソースを実装したもの。 .TP .BI /lib/libnss_files.so. X .\"O implements `files' source for glibc2 glibc2 に対して `files' ソースを実装したもの。 .TP .BI /lib/libnss_hesoid.so. X .\"O implements `hesoid' source for glibc2 glibc2 に対して `hesoid' ソースを実装したもの。 .TP .BI /lib/libnss_nis.so. X .\"O implements `nis' source for glibc2 glibc2 に対して `nis' ソースを実装したもの。 .TP .BI /lib/libnss_nisplus.so. X .\"O implements `nisplus' source for glibc2 glibc2 に対して `nisplus' ソースを実装したもの。 .TP .I /lib/libnss_nisplus.so.2 .\"O implements `nisplus' source for glibc 2.1 glibc 2.1 に対して `nisplus' ソースを実装したもの。 .PD .\"O .SH NOTES .SH 注意 .\"O Within each process that uses .\"O .BR nsswitch.conf , .\"O the entire file is read only once; if the file is later changed, the .\"O process will continue using the old configuration. .I nsswitch.conf を利用するそれぞれのプロセスでは、ファイルは一度しか読み込まれない。 もし nsswitch.conf があとで書き換えられても、 そのプロセスは古い設定のままで動作を継続する。 .LP .\"O With Solaris, it isn't possible to link programs using the NSS Service .\"O statically. .\"O With Linux, this is no problem. Solaris では NSS サービスを用いたプログラムをスタティックにリンクする ことはできない。 Linux では問題なくスタティックリンクできる。