<!DOCTYPE Article PUBLIC "-//OASIS//DTD DocBook V3.1//EN">

<Article>

<ArtHeader>

<Title>The Linux NIS(YP)/NYS/NIS+ HOWTO</Title>
<authorgroup>
 <AUTHOR>
  <FirstName>Thorsten</FirstName>
  <SurName>Kukuk</SurName
 </AUTHOR>

 <othercredit role="ja-translator">
  <othername>中野武雄</othername>
  <contrib>(日本語訳)</contrib>
 </othercredit>
</authorgroup>

<PubDate>v1.1.1, 18 November 2000</PubDate>

<Abstract>

<Para>
<IndexTerm><Primary>HOWTOs!NIS</Primary></IndexTerm>
<IndexTerm><Primary>HOWTOs!YP</Primary></IndexTerm>
<IndexTerm><Primary>HOWTOs!NYS</Primary></IndexTerm>
<IndexTerm><Primary>HOWTOs!NIS+</Primary></IndexTerm>
<!--O
This document describes how to configure Linux as NIS(YP) or NIS+ client
and how to install as NIS server.
-->
この文書では Linux を NIS(YP) または NIS+ のクライアントに設定する方法、
および NIS サーバをインストールする方法について述べます。
</Para>

</Abstract>

</ArtHeader>
<Sect1 id="intro">
<!--O
<Title>Introduction</Title>
-->
<Title>はじめに</Title>

<Para>
<!--O
More and more, Linux machines are installed as part of a network of
computers. To simplify network administration, most networks (mostly
Sun-based networks) run the Network Information Service. Linux machines
can take full advantage of existing NIS service or provide NIS service
themselves. Linux machines can also act as full NIS+ clients, this
support is in beta stage.
-->
Linux マシンはどんどんネットワークに接続されるようになってきました。
またネットワーク管理の簡略化のために、ほとんどのネットワーク
(特に Sun がベースになっているネットワーク) では NIS が動いています。 
Linux マシンでは、これらの NIS サービスを余すところなく受けたり、
また提供したりすることができます。
また Linux マシンは、完全に機能する
NIS+ クライアントとして動作させることもできます。
ただしこちらはまだベータの段階です。
</Para>

<Para>
<!--O
This document tries to answer questions about setting up NIS(YP) and NIS+
on your Linux machine. Don't forget to read
<XRef LinkEnd="portmapper">.
</Para>
-->
この文書は Linux マシンに NIS(YP) と
NIS+ をセットアップする方法について記述したものです。
いずれを採用するにしても
<XRef LinkEnd="portmapper">
は必ず読んで下さい。
</Para>

<Para>
<!--O
The NIS-Howto is edited and maintained by
-->
NIS-HOWTO は

<author>
<firstname>Thorsten</firstname>
<surname>Kukuk</surname>
</author>
<email>kukuk@suse.de</email>

によって編集・管理されています。
</Para>

<Para>
<!--O
The primary source of the information for the initial NIS-Howto was from:
-->
以前の NIS-HOWTO は、以下の人々によって執筆されました。彼らに感謝します。
</Para>

<InformalTable frame=none>
<tgroup cols=2>
<tbody>
<row><entry>Andrea Dell'Amico</entry><entry>&lt;adellam@ZIA.ms.it&gt;</entry></row>
<row><entry>Mitchum DSouza</entry><entry>&lt;Mitch.DSouza@NetComm.IE&gt;</entry></row>
<row><entry>Erwin Embsen</entry><entry>&lt;erwin@nioz.nl&gt;</entry></row>
<row><entry>Peter Eriksson</entry><entry>&lt;peter@ifm.liu.se&gt;</entry></row>
</tbody>
</tgroup>
</InformalTable>

<!--O
<Para>
who we should thank for writing the first versions of this document.
</Para>
-->

<Para>
訳注： v0.2 の日本語訳は根岸良征さんによって公開されました。
0.6 への追随と以降の管理は中野武雄が行っています。
</Para>


<Sect2>
<!--O
<Title>New Versions of this Document</Title>
-->
<Title>この文書の最新版</Title>

<Para>
<!--O
You can always view the latest version of this document on the
World Wide Web via the
URL <ULink
URL="http://www.suse.de/~kukuk/nis-howto/HOWTO/NIS-HOWTO.html"
>http://www.suse.de/~kukuk/nis-howto/HOWTO/NIS-HOWTO.html</ULink
>.
-->
この文書の最新版はいつでも WWW で閲覧することができます。 URL は
<ULink URL="http://www.suse.de/~kukuk/nis-howto/HOWTO/NIS-HOWTO.html"
>http://www.suse.de/~kukuk/nis-howto/HOWTO/NIS-HOWTO.html</ULink>
です。
</Para>

<Para>
<!--O
New versions of this document will also be uploaded to various
Linux WWW and FTP sites, including the LDP home page.
-->
このドキュメントの最新版は、
Linux 関連の WWW サイトや FTP サイトにも登録されます。
もちろん LDP のホームページにもあります。
</Para>

<Para>
<!--O
Links to translations of this document could be found at
<ULink
URL="http://www.suse.de/~kukuk/nis-howto/"
>http://www.suse.de/~kukuk/nis-howto/</ULink
>.
-->
翻訳文書へのリンクは
<ULink URL="http://www.suse.de/~kukuk/nis-howto/"
>http://www.suse.de/~kukuk/nis-howto/</ULink>
に集められています。
</Para>

<Para>
訳注：
日本語版の文書の最新版は
<ULink URL="http://www.linux.or.jp/JF/JFdocs/NIS-HOWTO/"
>JF Project のページ</ULink>
に置かれます。
</Para>

</Sect2>

<Sect2>
<!--O
<Title>Disclaimer</Title>
-->
<Title>免責</Title>

<Para>
<!--O
Although this document has been put together to the best of my
knowledge it may, and probably does contain errors. Please read any
README files that are bundled with any of the various pieces of
software described in this document for more detailed and accurate
information. I will attempt to keep this document as error free as
possible.
-->
この文章は私の知識を最大限集めて書いたつもりですが、
正確でない部分もあるかもしれません。
この文書で紹介しているプログラムについては、
それぞれに付属している README ファイルを必ず読んで下さい。
それらにはより詳しい説明やより正確な情報が書かれているはずですので。
もちろんこのドキュメントも
できるだけ間違いのないものにしていきたいと考えています。
</Para>

</Sect2>

<Sect2>
<!--O
<Title>Feedback and Corrections</Title>
-->
<Title>フィードバックと今後の改版</Title>

<Para>
<!--O
If you have questions or comments about this document, please feel
free to mail Thorsten Kukuk, at <ULink
URL="mailto:kukuk@suse.de"
>kukuk@suse.de</ULink
>. I welcome any
suggestions or criticisms. If you find a mistake with this
document, please let me know so I can correct it in the next
version. Thanks.
-->
この文書に関する質問やコメントがありましたら、お気軽に Thorsten Kukuk 
までメールを下さい。アドレスは
<email>kukuk@suse.de</email>
です。提案や批判も歓迎します。
この文書に誤りを見つけたら、私に連絡して下されば次の版で訂正します。
よろしくお願いします。
</Para>

<Para>
訳注：翻訳に対するコメントは中野武雄
<email>nakano@apm.seikei.ac.jp</email>
までお願いします。
</Para>

<Para>
<!--O
Please do <Emphasis>not</Emphasis> mail me questions about special problems with your Linux
Distribution! I don't know every Linux Distribution. But I will try to add
every solution you send me.
-->
なお、あなたの Linux 配布パッケージに特有の問題に関しては
私にメールを送らないで下さい！
私はすべての配布パッケージを知っている訳ではありません。
ただ、もし解決法も送っていただければ、文書に追加したいとは思っています。
</Para>

</Sect2>

<Sect2>
<!--O
<Title>Acknowledgements</Title>
-->
<Title>謝辞</Title>

<Para>
<!--O
We would like to thank all the people who have contributed (directly
or indirectly) to this document. In alphabetical order:
-->
このドキュメントを作成するにあたって、直接的あるいは間接的にお世話になり
ました以下の方々に感謝します。アルファベット順に：
</Para>

<InformalTable frame=none>
<tgroup cols=2>
<tbody>
<row><entry>Byron A Jeff</entry><entry>&lt;byron@cc.gatech.edu&gt;</entry></row>
<row><entry>Markus Rex</entry><entry>&lt;msrex@suse.de&gt;</entry></row>
<row><entry>Miquel van Smoorenburg</entry><entry>&lt;miquels@cistron.nl&gt;</entry></row>
<row><entry>Dan York</entry><entry>&lt;dyork@lodestar2.com&gt;</entry></row>
</tbody>
</tgroup>
</InformalTable>

<Para>
<!--O
Theo de Raadt is responsible for the original yp-clients code.
Swen Thuemmler ported the yp-clients code to Linux and also ported
the yp-routines in libc (again based on Theo's work).
Thorsten Kukuk has written the NIS(YP) and NIS+ routines for
GNU libc 2.x from scratch.
-->
<application>yp-clients</application>
のオリジナルコードは
<author>
<firstname>Theo</firstname>
<surname>de Raadt</surname>
</author>
によって作成されました。
<author>
<firstname>Swen</firstname>
<surname>Thuemmler</surname>
</author>
が
<application>yp-clients</application>
のコードを Linux に移植し、
yp 関連のルーチン (これも Theo の仕事) を libc に移植しました。
<author>
<firstname>Thorsten</firstname>
<surname>Kukuk</surname>
</author>
は GNU libc 2.x 向けの NIS(YP) と
NIS+ のルーチンをスクラッチから書きました。
</Para>

<Para>
訳注：日本語訳にあたっては、詳細な校正をして下さった
松本庄司さん・武井伸光さんをはじめ、
JF メーリングリストの皆さんにお世話になりました。
</Para>

</Sect2>

</Sect1>

<Sect1 id="glossary">
<!--O
<Title>Glossary and General Information</Title>
-->
<Title>用語集と一般的な情報</Title>

<Sect2>
<!--O
<Title>Glossary of Terms
-->
<Title>用語集
<IndexTerm><Primary>NIS!glossary</Primary></IndexTerm>
<IndexTerm><Primary>YP!glossary</Primary></IndexTerm>
<IndexTerm><Primary>NYS!glossary</Primary></IndexTerm>
<IndexTerm><Primary>NIS+!glossary</Primary></IndexTerm>
<IndexTerm><Primary>glossary!NIS/NYS/YP/NIS+</Primary></IndexTerm>
</Title>

<Para>
<!--O
In this document a lot of acronyms are used. Here are the most
important acronyms and a brief explanation:
-->
このドキュメント中では多くの省略語が使われています。
以下に重要なものの説明を簡単に挙げておきます。
</Para>

<Para>
<VariableList>

<VarListEntry>
<Term>DBM</Term>
<ListItem>
<Para>
<!--O
DataBase Management, a library of functions which
maintain key-content pairs in a data base.
-->
データベースマネジメント (DataBase Management)。
検索キーとデータとのペアを管理するデータベース機能を
持ったライブラリのこと。
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term>DLL</Term>
<ListItem>
<Para>
<!--O
Dynamically Linked Library, a library linked to an
executable program at run-time.
-->
動的リンクライブリ (Dynamically Linked Library)。
プログラムの実行時にリンクされるライブラリのこと。
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term>domainname</Term>
<ListItem>
<Para>
<!--O
A name "key" that is used by NIS clients to be
able to locate a suitable NIS server that serves that
domainname key. Please note that this does not necessarily
have anything at all to do with the DNS "domain"
(machine name) of the machine(s).
-->
NIS サーバが発行するキーワード。
NIS クライアント側が使用する NIS サーバを特定するのに用いられる。
この domainname は DNS の "domain" と
同じものにする必要はなく、むしろ別にすべきである。
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term>FTP</Term>
<ListItem>
<Para>
<!--O
File Transfer Protocol, a protocol used to transfer
files between two computers.
-->
ファイル転送プロトコル (File Transfer Protocol)。
コンピュータ間でファイルを転送する時に用いられるプロトコルの一つ。
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term>libnsl</Term>
<ListItem>
<Para>
<!--O
Name services library, a library of name service calls
(getpwnam, getservbyname, etc...) on SVR4 Unixes. GNU libc
uses this for the NIS (YP) and NIS+ functions.
-->
ネームサービスライブラリ (Name services libraly)。
SVR4 Unix におけるネームサービス関連の命令
(getpwnam, getservbyname など) のライブラリ。
GNU libc では NIS (YP) および NIS+ 機能にこのライブラリを用いる。
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term>libsocket</Term>
<ListItem>
<Para>
<!--O
Socket services library, a library for the socket
service calls (socket, bind, listen, etc...) on SVR4 Unixes.
ソケットサービスライブラリ (Socket services library)。
-->
SVR4 Unix で、
ソケット関係のシステムコール (socket, bind, listen など)
を提供するライブラリ。
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term>NIS</Term>
<ListItem>
<Para>
<!--O
Network Information Service, a service that provides
information, that has to be known throughout the network,
to all machines on the network. There is support for NIS
in Linux's standard libc library, which in the following text
is referred to as "traditional NIS".
-->
ネットワーク情報サービス (Network Information Service)。
ネットワーク上のすべての計算機で必要な情報を共有するサービスのこと。
Linux の標準 libc ライブラリには NIS のサポートが含まれており、
これをこの文書では "trad-NIS" と記す。
</Para>

<Para>
(訳注：原文では "traditional NIS" でしたが、長いので訳者が
勝手に造語しました)
</Para>

</ListItem>
</VarListEntry>
<VarListEntry>
<Term>NIS+</Term>
<ListItem>
<Para>
<!--O
Network Information Service (Plus :-), essentially NIS on
steroids. NIS+ is designed by Sun Microsystems Inc. as a
replacement for NIS with better security and better handling
of &lowbar;large&lowbar; installations.
-->
Network Information Service (Plus)。
基本的には NIS を機能アップしたもの。
NIS+ は Sun Microsystems Inc. によって設計され、
NIS を後継するものとされている。
セキュリティが強化され、
<emphasis>大きな</emphasis>システムに導入するのが容易になっている。
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term>NYS</Term>
<ListItem>
<Para>
<!--O
This is the name of a project and stands for NIS+, YP and Switch
and is managed by Peter Eriksson &lt;peter@ifm.liu.se&#62;. It contains
among other things a complete reimplementation of the NIS (= YP) code
that uses the Name Services Switch functionality of the NYS library.
-->
NYS は「NIS+, YP, Switch」を表すプロジェクト名である。
<author>
<firstname>Peter</firstname>
<surname>Eriksson</surname>
</author>
<email>pen@signum.se</email> が管理している。
このプロジェクトでは 
NIS(=YP) のコードを 0 から再実装しており、
NYS ライブラリのネームサービススイッチ機能を利用するようになっている。
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term>NSS</Term>
<ListItem>
<Para>
<!--O
Name Service Switch. The /etc/nsswitch.conf file determines the order
of lookups performed when a certain piece of information is requested.
-->
ネームサービススイッチ (Name Service Switch)。
<filename>/etc/nsswitch.conf</filename>
ファイルによって、
各種の情報のリクエストに対してどんな順番で検索を行うかを決定する。
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term>RPC</Term>
<ListItem>
<Para>
<!--O
Remote Procedure Call. RPC routines allow C programs to
make procedure calls on other machines across the network.
When people talk about RPC they most often mean the Sun RPC
variant.
-->
リモートプロシジャーコール (Remote Procedure Call)。
C プログラム内で RPC ルーチンを利用すれば、
ネットワーク上にある他の計算機上の手続き
(サブルーチン) を呼びだすことができる。
通常の文脈においては Sun の RPC 実装の意味で用いられることが多い。
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term>YP</Term>
<ListItem>
<Para>
<!--O
Yellow Pages(tm), a registered trademark in the UK of
British Telecom plc.
-->
イエローページ (Yellow Pages (TM))
Yellow Pages は 英国 British Telecom 社の登録商標。
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term>TCP-IP</Term>
<ListItem>
<Para>
<!--O
Transmission Control Protocol/Internet Protocol. It is the
data communication protocol most often used on Unix machines.
-->
Transmission Control Protocol/Internet Protocol の略。 TCP/IP は 
Unix で非常によく使われているデータ通信プロトコルである。
</Para>
</ListItem>
</VarListEntry>
</VariableList>
</Para>

</Sect2>

<Sect2>
<!--O
<Title>Some General Information
-->
<Title>一般的な情報
<IndexTerm><Primary>NIS!general information</Primary></IndexTerm>
<IndexTerm><Primary>YP!general information</Primary></IndexTerm>
<IndexTerm><Primary>NYS!general information</Primary></IndexTerm>
<IndexTerm><Primary>NIS+!general information</Primary></IndexTerm>
</Title>

<Para>
<!--O
The next four lines are quoted from the Sun(tm) System &amp; Network
Administration Manual:
-->
以下の内容は Sun(tm) System &amp; Network Administration Manual
からの引用です。
</Para>

<Blockquote>
<Para>
<!--O
    "NIS was formerly known as Sun Yellow Pages (YP) but
     the name Yellow Pages(tm) is a registered trademark
     in the United Kingdom of British Telecom plc and may
     not be used without permission."
-->
NIS はかつて サン・イエローページ (Sun Yellow Pages, YP)
と呼ばれていました。
しかし「Yellow Pages」は英国 British Telecom 社の登録商標で、
許可無く使用することができませんので、NIS と呼ぶことにしました。
</Para>
</Blockquote>

<Para>
<!--O
NIS stands for Network Information Service. Its purpose is to
provide information, that has to be known throughout the network,
to all machines on the network. Information likely to be
distributed by NIS is:
-->
NIS は Network Information Service の略です。
ネットワーク上のすべての計算機で共有すべき情報を提供するために用いられます。
NIS で提供される情報とは、例えば以下のようなものです。
</Para>

<Para>

<ItemizedList>
<ListItem>

<Para>
<!--O
login names/passwords/home directories (/etc/passwd)
-->
ログイン名、パスワード、ホームディレクトリ (<filename>/etc/passwd</filename>)
</Para>
</ListItem>
<ListItem>

<Para>
<!--O
group information (/etc/group)
-->
グループ情報 (<filename>/etc/group</filename>)
</Para>
</ListItem>

</ItemizedList>

</Para>

<Para>
<!--O
If, for example, your password entry is recorded in the NIS
passwd database, you will be able to login on all machines on the
network which have the NIS client programs running.
-->
例えば、あなたのパスワードが
NIS のパスワードデータベースに登録されているとしましょう。
するとあなたは、
そこで NIS のクライアントプログラムが動いていれば、
ネットワーク上のどの計算機にもログインすることができるようになるのです。
</Para>

<Para>
<!--O
Sun is a trademark of Sun Microsystems, Inc. licensed to
SunSoft, Inc.
-->
Sun は Sun Microsystems 社の商標であり、
SunSoft 社にライセンス供与されています。
</Para>

</Sect2>

</Sect1>

<Sect1 id="selection">
<!--O
<Title>NIS, NYS or NIS+ ?</Title>
-->
<Title>NIS か NYS か NIS+ か</Title>

<Sect2>
<!--O
<Title>libc 4/5 with traditional NIS or NYS ?
-->
<Title>libc 4/5 では trad-NIS か、それとも NYS ライブラリか？
<IndexTerm><Primary
>libc4/5, use with NIS/NYS</Primary></IndexTerm>

<IndexTerm><Primary
>NIS/NYS, use with libc4/5</Primary></IndexTerm>
</Title>

<Para>
<!--O
The choice between "traditional NIS" or the NIS code in the NYS library
is a choice between laziness and maturity vs. flexibility and love of
adventure.
-->
trad-NIS を用いるか NYS ライブラリの NIS コードを用いるかは、
「低機能だが安定」をとるか「柔軟だが冒険」をとるかの選択と言えます。
</Para>

<Para>
<!--O
The "traditional NIS" code is in the standard C library and has been
around longer and sometimes suffers from its age and slight
inflexibility.
-->
trad-NIS のコードは標準 C ライブラリに入ってからだいぶ経っています。
生まれが古い分、やや柔軟性に欠けるところがあります。
</Para>

<Para>
<!--O
The NIS code in the NYS library requires you to recompile the libc
library to include the NYS code into it (or maybe you can
get a precompiled version of libc from someone who has already done it).
-->
一方 NYS ライブラリの NIS コードを用いるには、
libc ライブラリを再コンパイルして
libnsl のコードを libc の中に含める必要があります
(そのようにコンパイルされた libc ライブラリを入手できるかもしれません)。
</Para>

<Para>
<!--O
Another difference is that the traditional NIS code has some support
for NIS Netgroups, which the NYS code doesn't. On the other hand
the NYS code allows you to handle Shadow Passwords in a transparent
way. The "traditonal NIS" code doesn't support Shadow Passwords over NIS.
-->
また trad-NIS のコードでは NIS のネットグループ機能が使えますが、 
NYS のコードには実装されていません。逆に NYS のコードでは
Shadow Password を透過的に扱うことができるようになっていますが、 
trad-NIS のコードは NIS 上での Shadow パスワードをサポートしていません。
</Para>

</Sect2>

<Sect2>
<!--O
<Title>glibc 2 and NIS/NIS+
-->
<Title>glibc 2 と NIS/NIS+
<IndexTerm><Primary
>glibc2, use with NIS/NIS+</Primary></IndexTerm>

<IndexTerm><Primary
>NIS/NIS+, use with glibc2</Primary></IndexTerm>
</Title>

<Para>
<!--O
Forgot all this if you use the new GNU C Library 2.x (aka libc6). It
has real NSS (name switch service) support, which makes it very flexible,
and contains support for the following NIS/NIS+ maps: aliases, ethers, group,
hosts, netgroups, networks, protocols, publickey, passwd, rpc, services
and shadow. The GNU C Library has no problems with shadow passwords over NIS.
-->
GNU C Library 2.x (libc6) を使っている場合は、
以上の全ては忘れて下さい。
libc6 では NSS (ネームスイッチサービス) を完全にサポートしており、
非常に柔軟な運用ができるようになっています。
また以下の NIS／NIS+ マップがサポートされています:
aliases, ethers, group, hosts, netgroups, networks, protocols,
publickey, passwd, rpc, services, shadow.
GNU C Library では、
shadow パスワードを NIS でまったく問題なく扱うことができます。
</Para>

</Sect2>

<Sect2>
<!--O
<Title>NIS or NIS+ ?
-->
<Title>NIS か NIS+ か？
<IndexTerm><Primary
>NIS vs. NIS+</Primary></IndexTerm>
</Title>

<Para>
<!--O
The choice between NIS and NIS+ is easy - use NIS if you don't have to
use NIS+ or have severe security needs. NIS+ is &lowbar;much&lowbar; more problematic
to administer (it's pretty easy to handle on the client side, but the
server side is horrible). Another problem is that the support for NIS+
under Linux is still under developement - you need the latest glibc 2.1.
There is an unsupported port of the glibc NIS+ support for libc5 as
dropin replacement.
-->
どちらを選ぶか悩む必要はありません。
特にセキュリティに過敏になる必要がなかったり、
NIS+ を使わねばならない理由がないのなら、NIS を使いましょう。
<emphasis>NIS+ の管理はずっと大変です</emphasis>
(クライアント側ではそれほどでもありませんが、サーバー管理は地獄です)。
それに Linux 上での NIS+ はまだ開発段階なのです。
利用するには最新版の glibc 2.1 が必要があります。
ちょっと試してみたい場合には、glibc の NIS+ サポートを libc5
に移植したものも存在します (ただしこれは未サポート)。
</Para>

</Sect2>

</Sect1>

<Sect1 id="mechanism">
<!--O
<Title>How it works</Title>
-->
<Title>動作原理</Title>

<Sect2>
<!--O
<Title>How NIS works
-->
<Title>NIS の動作原理
<IndexTerm><Primary
>NIS/YP, theory of operation</Primary></IndexTerm>
</Title>

<Para>
<!--O
Within a network there must be at least one machine acting as a NIS
server. You can have multiple NIS servers, each serving different NIS
"domains" - or you can have cooperating NIS servers, where one is the
master NIS server, and all the other are so-called slave NIS servers
(for a certain NIS "domain", that is!) - or you can have a mix
of them...
-->
少なくとも 1 台の NIS のサーバーがネットワーク上に必要です。
複数のサーバを稼動させることもできます。
この場合はそれぞれを異なった NIS 「ドメイン」のサーバとするか、
あるいは 2 台のサーバをひとつのドメイン上で協調して動作させることになります。
後者の構成では 1 台のサーバが「マスターサーバ」となり、
その他のサーバは全て「スレーブサーバ」と呼ばれます
(1 つの「ドメイン」に対する構成です)。
ドメインを複数、それぞれに対するサーバも複数、
といったような構成も可能です。
</Para>

<Para>
<!--O
Slave servers only have copies of the NIS databases and receive these
copies from the master NIS server whenever changes are made to the
master's databases.  Depending on the number of machines in your
network and the reliability of your network, you might decide to
install one or more slave servers.  Whenever a NIS server goes down or
is too slow in responding to requests, a NIS client connected to that
server will try to find one that is up or faster.
-->
スレーブサーバは、
マスターサーバの NIS データベースのコピー保持だけをします。
マスターサーバの NIS データベースが変更されると、逐一それを受け取ります。
ネットワークに接続されている計算機の台数とネットワークの信頼性を考慮し、
スレーブサーバをインストールするかどうか
(インストールする場合はその台数) を決めて下さい。
NIS クライアントは、NIS サーバが「落ちて」いたり、
レスポンスが遅かったりする場合には、
落ちていないサーバやもっとレスポンスの速いサーバとの接続を試みます。
</Para>

<Para>
<!--O
NIS databases are in so-called DBM format, derived from ASCII
databases.  For example, the files <Literal remap="tt">/etc/passwd</Literal> and
<Literal remap="tt">/etc/group</Literal> can be directly converted to DBM format using
ASCII-to-DBM translation software ("makedbm", included with the
server software). The master NIS server should have both, the ASCII
databases and the DBM databases.
-->
NIS データベースは ASCII 形式のデータベースから変換された、
いわゆる DBM フォーマットになっています。例えば
<filename>/etc/passwd</filename>
や 
<filename>/etc/group</filename>
といったファイルは、 ASCII-DBM 変換プログラム
(<command>makedbm</command>: サーバソフトに入っています)
を使って直接 DBMフォーマットに変換できます。
NIS のマスターサーバは、
ASCII 形式と DBM 形式のデータベースとの両方を持っていなくてはなりません。
</Para>

<Para>
<!--O
Slave servers  will be notified of any change to the NIS maps, (via the
"yppush" program), and automatically retrieve the necessary changes in
order to synchronize their databases. NIS clients do not need to do
this since they always talk to the NIS server to read the information
stored in it's DBM databases.
-->
スレーブサーバは NIS マップが変更されると通知を受けます
(<command>yppush</command> プログラムが用いられます)。
するとスレーブサーバは必要な変更を行い、
データベースを同期させます。
NIS クライアントにこのような作業をする必要はありません。
クライアントは常に最新の DBM データベースの内容を
NIS サーバに読みに行くからです。
</Para>

<Para>
<!--O
Old ypbind versions do a broadcast to find a running NIS server.
This is insecure, due the fact that anyone may install a NIS server
and answer the broadcast queries. Newer Versions of ypbind
(ypbind-3.3 or ypbind-mt) are able to get the server from a
configuration file - thus no need to broadcast.
-->
<command>ypbind</command> の古いバージョンでは、
動作中の NIS サーバを探すのにブロードキャストを用いていました。
これにはセキュリティ上の問題がありました。
なぜなら誰かが NIS サーバをインストールして、
ブロードキャストの問い合わせに答えるようにできるからです。
新しいバージョンの <command>ypbind</command>
(ypbind-3.3 または ypbind-mt) では、
サーバを設定ファイルから取得できます
- したがってブロードキャストは不要です。
</Para>

</Sect2>

<Sect2>
<!--O
<Title>How NIS+ works
-->
<Title>NIS+ の動作原理
<IndexTerm><Primary
>NIS+!theory of operation</Primary></IndexTerm>
</Title>

<Para>
<!--O
NIS+ is a new version of the network information nameservice from Sun.
The biggest difference between NIS and NIS+ is that NIS+ has
support for data encryption and authentication over secure RPC.
-->
NIS+ は Sun による新しいネットワークインフォメーションサービスです。
NIS と NIS+ の最も大きな違いは、NIS+ ではデータの暗号化と
secure RPC を通した認証とが可能になっている点です。
</Para>

<Para>
<!--O
The  naming  model of NIS+ is based upon a tree structure. Each node in
the tree corresponds to an NIS+ object, from which we have six types:
directory, entry, group, link, table and private.
-->
NIS+ の命名モデルはツリー構造に基づいています。
ツリーのそれぞれのノードが NIS+ のオブジェクトに対応しており、
これには六つのタイプがあります。
<simplelist type="inline">
 <member>ディレクトリ (directory)</member>
 <member>エントリ (entry)</member>
 <member>グループ (group)</member>
 <member>リンク (link)</member>
 <member>テーブル (table)</member>
 <member>プライベート (private)</member>
</simplelist>
です。
</Para>

<Para>
<!--O
The NIS+ directory that forms the root of the NIS+ namespace is called
the root directory. There are two special NIS+ directories:
org&lowbar;dir and groups&lowbar;dir. The org&lowbar;dir directory consists of all
administration tables, such as passwd, hosts, and mail&lowbar;aliases. The
groups&lowbar;dir directory consists of NIS+ group objects which are used for
access control. The collection of org&lowbar;dir, groups&lowbar;dir and their parent
directory is referred to as an NIS+ domain.
-->
NIS+ の名前空間でルートとなる NIS+ ディレクトリは
root ディレクトリと呼ばれます。
NIS+ には二つの特別なディレクトリが存在します。 
<filename>org_dir</filename>
と
<filename>groups_dir</filename>
です。
<filename>org_dir</filename>
ディレクトリにはすべての管理テーブルが含まれます。
例えば
<filename>passwd</filename>,
<filename>hosts</filename>, 
<filename>mail_aliases</filename>
などです。
<filename>groups_dir</filename>
ディレクトリにはアクセスコントロールに用いられる
NIS+ グループオブジェクトが含まれます。 
<filename>org_dir</filename>
と
<filename>groups_dir</filename>
およびそれらの親ディレクトリを集めたものが
NIS+ ドメインとして参照されます。
</Para>

</Sect2>

</Sect1>

<Sect1 id="portmapper">
<!--O
<Title>The RPC Portmapper
-->
<Title> RPC ポートマッパ
<IndexTerm><Primary
>RPC portmapper</Primary></IndexTerm>
<IndexTerm><Primary
>portmapper, RPC</Primary></IndexTerm>
<IndexTerm><Primary
>NIS!use of RPC portmapper</Primary></IndexTerm>
</Title>

<Para>
<!--O
To run any of the software mentioned below you will need to run the
program /usr/sbin/portmap. Some Linux distributions already have
the code in the /sbin/init.d/ or /etc/rc.d/ files to start up this
daemon. All you have to do is to activate it and reboot your Linux
machine. Read your Linux Distribution Documentation how to do this.
-->
これから説明していくソフトウェアを動かすためには、まず 
<command>/usr/sbin/rpc.portmap</command>
を動作させておく必要があります。
Linux の配布パッケージの中には、
このデーモンを立ち上げるためのコマンドが 
<filename>/sbin/init.d/</filename> や
<filename>/etc/rc.d/</filename> に書き込んであるものもありますので、
その場合は該当部分をアンコメントしてリブートするだけです。
実際のやり方はディストリビューションのドキュメントを読みましょう。
</Para>

<Para>
<!--O
The RPC portmapper (portmap(8)) is a server that converts RPC program
numbers into TCP/IP (or UDP/IP) protocol port numbers. It must be
running in order to make RPC calls (which is what the NIS/NIS+ client
software does) to RPC servers (like a NIS or NIS+ server) on that machine.
When an RPC server is started, it will tell portmap what port number it
is listening to, and what RPC program numbers it is prepared to serve.
When a client wishes to make an RPC call to a given program number, it
will first contact portmap on the server machine to determine the port
number where RPC packets should be sent.
-->
RPC ポートマッパ (portmap(8)) は、
RPC プログラム番号を TCP/IP ポート番号に変換するサーバプログラムです。
NIS クライアントプログラムがやっているように、
RPC サーバ (NIS サーバなど) に RPC 呼びだしを行うには、
RPC ポートマッパが動いている必要があります。
RPC サーバプログラムは、
監視する TCP/IP ポート番号とデータを提供する RPC プログラム番号を、
起動時にポートマッパに伝えます。
クライアントプログラムが、
ある RPC プログラム番号にコールを行う際には、
まずサーバマシン上の RPC ポートマッパと交信して、
どの TCP/IP ポート番号に RPC のパケットを送れば良いのかを決定します。
</Para>

<Para>
<!--O
Since RPC servers could be started by inetd(8), portmap should
be running before inetd is started.
-->
RPC サーバプログラムは inetd(8) からも起動できますが、
その場合は inetd より前に RPC ポートマッパを起動するようにして下さい。
</Para>

<Para>
<!--O
For secure RPC, the portmapper needs the Time service. Make sure, that the
Time service is enabled in /etc/inetd.conf on all hosts:
-->
secure RPC を用いる場合には、ポートマッパは time サービスを必要とします。
すべてのホストの <filename>/etc/inetd.conf</filename> で、
以下のように time サービスが利用可能になっていることを確認して下さい。
</Para>

<ProgramListing>
#
# Time service is used for clock syncronization.
#
time    stream  tcp     nowait  root    internal
time    dgram   udp     wait    root    internal
</ProgramListing>

<Para>
<!--O
IMPORTANT: Don't forget to restart inetd after changes on its
configuration file !
-->
重要：設定ファイル変更したあと inetd を再起動するのを忘れないこと!
</Para>

</Sect1>

<Sect1 id="nis-setup">
<!--O
<Title>What do you need to set up NIS?
-->
<Title>NIS の設定
<IndexTerm><Primary
>NIS!setting up</Primary></IndexTerm>
</Title>

<Sect2>
<!--O
<Title>Determine whether you are a Server, Slave or Client.
-->
<Title>マスターサーバ、スレーブサーバ、クライアントを決める
<IndexTerm><Primary
>NIS!determining system type</Primary></IndexTerm>
</Title>

<Para>
<!--O
To answer this question you have to consider two cases:
-->
まず以下の二つの場合を考える必要があります。
</Para>

<Para>

<OrderedList>
<ListItem>

<Para>
<!--O
Your machine is going to be part of a network with existing NIS servers
-->
接続するネットワーク上に NIS サーバがある場合。
</Para>
</ListItem>
<ListItem>

<Para>
<!--O
You do not have any NIS servers in the network yet
-->
接続するネットワーク上に NIS サーバがない場合。
</Para>
</ListItem>

</OrderedList>

</Para>

<Para>
<!--O
In the first case, you only need the client programs (ypbind, ypwhich,
ypcat, yppoll, ypmatch). The most important program is ypbind. This
program must be running at all times, which means, it should always appear
in the list of processes. It is a daemon process and needs to
be started from the system's startup file (eg. /etc/init.d/nis,
/sbin/init.d/ypclient, /etc/rc.d/init.d/ypbind, /etc/rc.local).
As soon as ypbind is running your system has become a NIS client.
-->
最初のケースでは
<command>ypbind</command>,
<command>ypwhich</command>,
<command>ypcat</command>,
<command>yppoll</command>,
<command>ypmatch</command>
といったクライアントプログラムを起動するだけで
使えるようになります。一番重要なのは
<command>ypbind</command> で、
このプログラムは常に実行されている必要があります
(つまり
<command>ps</command>
コマンドを実行したときにプロセステーブルに表示されなければなりません)。
<command>ypbind</command> はいわゆるデーモンプロセスで、
システムのスタートアップファイルから起動する必要があります
(つまり
<filename>/etc/init.d/nis</filename>,
<filename>/sbin/init.d/ypclient</filename>,
<filename>/etc/rc.d/init.d/ypbind</filename>,
<filename>/etc/rc.local</filename> など)。
<command>ypbind</command> が起動されれば、
その計算機は その時点から NIS クライアントとなります。
</Para>

<Para>
<!--O
In the second case, if you don't have NIS servers, then you will also
need a NIS server program (usually called ypserv). <XRef LinkEnd="ypserv">
describes how to set up a NIS server on your Linux machine using the "ypserv"
daemon.
-->
二番目のケース、つまり NIS サーバがない場合には、
NIS サーバプログラム (通常は <command>ypserv</command>) も必要となります。
この文書の
<XRef LinkEnd="ypserv">
では、この <command>ypserv</command> デーモンを用いて
Linux マシンを NIS サーバに設定する方法について説明しています。
</Para>

</Sect2>

<Sect2>
<!--O
<Title>The Software
-->
<Title>ソフトウェア
<IndexTerm><Primary
>NIS!library requirements</Primary></IndexTerm>
</Title>

<Para>
<!--O
The system library "/usr/lib/libc.a" (version 4.4.2 and better) or the
shared library "/lib/libc.so.x" contain all necessary system calls to
succesfully compile the NIS client and server software. For the
GNU C Library 2 (glibc 2.x), you also need /lib/libnsl.so.1.
-->
バージョン 4.4.2 以降のシステムライブラリ
<filename>/usr/lib/libc.a</filename>
もしくは共有ライブラリ
<filename>/lib/libc.so.x</filename> には、
NIS のクライアント・サーバプログラムのコンパイルに必要なシステムコールが
すべて含まれています。
GNU C Library 2 (glibc 2.x) では
<filename>/lib/libnsl.so.1</filename> も必要です。
</Para>

<Para>
<!--O
Some people reported that NIS only works with "/usr/lib/libc.a" version
4.5.21 and better so if you want to play it safe don't use older
libc's.  The NIS client software can be obtained from:
-->
NIS は <filename>/usr/lib/libc.a</filename> のバージョン
4.5.21 以上でしか動かないという報告がありますので、
安全のためには古いものは使わない方が良いでしょう。
NIS のクライアントプログラムは以下で入手できます。
</Para>

<InformalTable frame=none>
<tgroup cols=2>
<thead>
<row>
 <entry>Site and Directory</entry>
 <entry>Filename</entry>
</row>
</thead>
<tbody>
<row>
 <entry morerows=3><ULink URL="ftp://ftp.kernel.org/pub/linux/utils/net/NIS/"
  >ftp.kernel.org:/pub/linux/utils/net/NIS</ULink></entry>
 <entry>yp-tools-2.4.tar.gz</entry>
</row>

<row><entry>ypbind-mt-1.7.tar.gz</entry></row>
<row><entry>ypbind-3.3.tar.gz</entry></row>
<row><entry>ypbind-3.3-glibc5.diff.gz</entry></row>
</tbody>
</tgroup>
</InformalTable>

<Para>
<!--O
Once you obtained the software, please follow the instructions which
come with the software. yp-clients 2.2 are for use with libc4 and libc5
until 5.4.20. libc 5.4.21 and glibc 2.x needs yp-tools 1.4.1 or later.
The new yp-tools 2.4 should work with every Linux libc. Since there was
a bug in the NIS code, you shouldn't use libc 5.4.21-5.4.35. Use libc
5.4.36 or later instead, or the most YP programs will not work.
ypbind 3.3 will work with all libraries, too. If you use gcc 2.8.x or
greater, egcs or glibc 2.x, you should add the ypbind-3.3-glibc5.diff
patch to ypbind 3.3. If possible you should avoid the use of ypbind 3.3
for security reasons. 
ypbind-mt is a new, multithreaded daemon. It needs a Linux 2.2 kernel
and glibc 2.1 or later.
-->
ソフトを手に入れたら、同梱されている説明にしたがって下さい。 
yp-clients 2.2 は libc4 または 5.4.20 までの libc5 と共に用いて下さい。 
libc 5.4.21 以降と glibc 2.x には yp-tools 1.4.1 以降が必要です。
新しい yp-tools のバージョン 2.4 は、すべての Linux libc で動作します。 
5.4.21 から 5.4.35 までの libc は、
NIS のコードにバグがあるので使わない方が良いでしょう。
libc 5.4.36 以降を使わないと、ほとんどの YP プログラムは動作しないでしょう。
ypbind 3.3 もすべてのライブラリで動作します。
gcc 2.8.x 以降か egcs、 glibc 2.x を利用している場合は、
<filename>ypbind-3.3-glibc5.diff</filename> パッチを
ypbind 3.3 に当てる必要があります。
セキュリティに問題があるので、
可能なら ypbind 3.3 は使わないほうが良いでしょう。
ypbind-mt は、新しく開発されたマルチスレッドのデーモンです。
これには Linux 2.2 カーネルと glibc 2.1 以降が必要です。
</Para>

</Sect2>
</Sect1>

<Sect1 id="nis-client">
<!--O
<Title>Setting Up the NIS Client
-->
<Title>NIS クライアントの設定
</Title>
<Sect2>
<!--O
<Title>The ypbind daemon
-->
<Title>ypbind デーモン
<IndexTerm><Primary
>NIS!ypbind daemon</Primary></IndexTerm>

<IndexTerm><Primary
>ypbind NIS daemon</Primary></IndexTerm>

<IndexTerm><Primary
>daemon!ypbind</Primary></IndexTerm>
</Title>

<Para>
<!--O
After you have succesfully compiled the software you are now ready
to install it. A suitable place for the ypbind daemon is the directory
/usr/sbin. Some people may tell you that you don't need
ypbind on a system with NYS. This is wrong. ypwhich and ypcat need it
always.
-->
ソフトウェアがうまくコンパイルできたらインストールしましょう。
<command>ypbind</command> デーモンは
<filename>/usr/sbin</filename>
ディレクトリに入れると良いでしょう。
NYS のシステムでは
<command>ypbind</command> は必要ないと言う人がいるようですが、
これは間違っています。 
<command>ypwhich</command> と
<command>ypcat</command> は、
かならず <command>ypbind</command> を必要とします。
</Para>

<Para>
<!--O
You must do this as root of course. The other binaries (ypwhich,
ypcat, yppasswd, yppoll, ypmatch) should go in a directory accessible
by all users, normally /usr/bin.
-->
<filename>ypbind</filename>
のインストールはもちろんスーパーユーザで行う必要があります。
他のバイナリ (<filename>ypwhich</filename>,
<filename>ypcat</filename>,
<filename>yppoll</filename>,
<filename>ypmatch</filename>)
はすべてのユーザーからアクセス可能なディレクトリに置きましょう。
通常は
<filename>/usr/bin</filename>
が良いでしょう。
</Para>

<Para>
<!--O
Newer ypbind versions have a configuration file called /etc/yp.conf. You can
hardcode a NIS server there - for more info see the manual page for ypbind(8).
You also need this file for NYS.
An example:
-->
最近の <command>ypbind</command> には設定ファイル
<filename>/etc/yp.conf</filename> があります。
ここに NIS サーバを直に書いておくこともできます。
詳しくは ypbind(8) のマニュアルを読んで下さい。
このファイルは NYS でも必要です。以下は例です。
</Para>

<ProgramListing>
ypserver 10.10.0.1
ypserver 10.0.100.8
ypserver 10.3.1.1
</ProgramListing>

<Para>
<!--O
If the system cam resolv the hostnames without NIS, you may use
the name, otherwise you have to use the IP address. ypbind 3.3 has a bug
and will only use the last entry (ypserver 10.3.1.1 in the example). All
other entries are ignored. ypbind-mt handle this correct and uses
that one, which answerd at first.
-->
NIS なしでもホスト名の解決ができるシステムでは、
IP アドレスでなく名前を用いることができます。
そうでなければ IP アドレスを用います。
ypbind 3.3 にはバグがあり、最後のエントリ
(上記の例では ypserver 10.3.1.1) しか用いられず、
他は全て無視されます。
ypbind-mt では正しく扱うことができ、
最初に返事したサーバが用いられます。
</Para>

<Para>
<!--O
It might be a good idea to test ypbind before  incorporating it in the
startup files. To test ypbind do the following:
-->
<command>ypbind</command>
をスタートアップファイルに入れる前に
テストしておくことをお勧めします。
<command>ypbind</command>
のテストは以下のようにして行います。
</Para>

<Para>

<ItemizedList>
<ListItem>

<Para>
<!--O
Make sure you have your YP-domain name set. If it is not set then
issue the command:
-->
YP のドメインネームが設定されていることを確認して下さい。
設定されていない場合は以下のようにします。


<Screen>
/bin/domainname nis.domain
</Screen>


<!--O
where <Literal remap="tt">nis.domain</Literal> should be some string &lowbar;NOT&lowbar; normally
associated with the DNS-domain name of your machine! The reason for
this is that it makes it a little harder for external crackers
to retreive the password database from your NIS servers. If you
don't know what the NIS domain name is on your network, ask
your system/network administrator.
-->
<userinput>nis.domain</userinput>
は通常適当な文字列で、
<emphasis>あなたのマシンの
DNS ドメインネームとは違うものにすべき</emphasis>です。
こうしておけば、外部のクラッカーがサーバから NIS
パスワードデータベースを盗んでいくのがわずかながら困難になります。
NIS ドメイン名を知らない場合は
システム管理者かネットワーク管理者に尋ねて下さい。

</Para>
</ListItem>
<ListItem>

<Para>
<!--O
Start up "/usr/sbin/portmap" if it is not already running.
-->
<command>/usr/sbin/rpc.portmap</command> が起動されていなければ起動します。

</Para>
</ListItem>
<ListItem>

<Para>
<!--O
Create the directory "/var/yp" if it does not exist.
-->
<filename>/var/yp</filename> というディレクトリがなければ作成します。

</Para>
</ListItem>
<ListItem>

<Para>
<!--O
Start up "/usr/sbin/ypbind"
-->
<command>/usr/sbin/ypbind</command> を起動します。

</Para>
</ListItem>
<ListItem>

<Para>
<!--O
Use the command "rpcinfo -p localhost" to check if ypbind
was able to register its service with the portmapper. The
output should look like:
-->
ypbind がサービス内容をポートマッパに登録できたかどうか確かめるために、
<command>rpcinfo <option>-p</option> localhost</command>
というコマンドを実行して下さい。
以下のような出力が現われるはずです。

<Screen>
program vers proto   port
 100000    2   tcp    111  portmapper
 100000    2   udp    111  portmapper
 100007    2   udp    637  ypbind
 100007    2   tcp    639  ypbind
</Screen>

<!--O
or
-->
あるいは使っているバージョンによっては

<Screen>
program vers proto   port
 100000    2   tcp    111  portmapper
 100000    2   udp    111  portmapper
 100007    2   udp    758  ypbind
 100007    1   udp    758  ypbind
 100007    2   tcp    761  ypbind
 100007    1   tcp    761  ypbind
</Screen>

<!--O
Depending on the ypbind version you are using.
-->
のようになるかもしれません。
</Para>
</ListItem>
<ListItem>

<Para>
<!--O
You may also run "rpcinfo -u localhost ypbind". This command
should produce something like:
-->
<command>rpcinfo <option>-u</option> localhost ypbind</command>
も実行してみて下さい。以下のような表示が出るはずです。

<Screen>
program 100007 version 2 ready and waiting
</Screen>

<!--O
or
-->
あるいはインストールした ypbind のバージョンによっては

<Screen>
program 100007 version 1 ready and waiting
program 100007 version 2 ready and waiting
</Screen>

<!--O
The output depends on the ypbind version you have installed.
Important is only the "version 2" message.
-->
のような出力になるかもしれません。
重要なのは "version 2" のメッセージだけです。
</Para>
</ListItem>

</ItemizedList>

</Para>

<Para>
<!--O
At this point you should be able to use NIS client programs like ypcat,
etc...  For example, "ypcat passwd.byname" will give you the entire NIS
password database.
-->
ここまで来れば <command>ypcat</command>
のような NIS クライアントプログラムを実行できるはずです。
例えば NIS のパスワードデータベースを参照したい場合には、
<command>ypcat <replaceable>passwd.byname</replaceable></command>
とします。
</Para>

<!--O
<Para>
IMPORTANT: If you skipped the test procedure then make sure you have set
the domain name, and created the directory
</Para>

<Para>

<Screen>
    /var/yp
</Screen>

</Para>

<Para>
This directory MUST exist for ypbind to start up succesfully.
</Para>
-->
<Para>
重要: もし上述の <command>ypbind</command> のテストを省略した場合、
少なくともドメインネームが設定してあることと
<filename>/var/yp</filename>
という名前のディレクトリが作ってあることを確認して下さい。
<filename>/var/yp</filename> がないと 
<command>ypbind</command> は正常に起動できません。
</Para>

<Para>
<!--O
To check if the domainname is set correct, use the /bin/ypdomainname from
yp-tools 2.2. It uses the yp&lowbar;get&lowbar;default&lowbar;domain() function which is more
restrict. It doesn't allow for example the "(none)" domainname, which
is the default under Linux and makes a lot of problems.
-->
ドメインネームの設定が正しいかどうかをチェックするには、
yp-tools 2.2 の
<command>/bin/ypdomainname</command> を使って下さい。
このプログラムは
yp_get_default_domain() 関数を使うので、
より厳しいチェックができます。
例えば Linux でデフォルトになっている
(そして多くの問題の原因になっている)
"(none)" のようなドメイン名は、
このプログラムでは許可されません。
</Para>

<Para>
<!--O
If the test worked you may now want to change your startupd files
so that ypbind will be started at boot time and your system will
act as a NIS client. Make sure that the domainname will
be set before you start ypbind.
-->
テストがうまくいったらスタートアップファイルを変更して、ブート時に
<command>ypbind</command> が起動されるようにしておくと良いでしょう。
自動的に NIS クライアントとしての活動が開始されます。
<command>ypbind</command> の起動前に、
ドメインネームが設定されるようにするのも忘れないこと。
</Para>

<Para>
<!--O
Well, that's it. Reboot the machine and watch the boot messages to see
if ypbind is actually started.
-->
以上で設定は終了しました。リブートして、ブートメッセージで 
<command>ypbind</command> が正常に動作しているかどうか確認して下さい。
</Para>

</Sect2>

<Sect2>
<!--O
<Title>Setting up a NIS Client using Traditional NIS
-->
<Title>trad-NIS を用いた NIS クライアントをセットアップする
<IndexTerm><Primary
>NIS!client setup</Primary></IndexTerm>
</Title>

<Para>
<!--O
For host lookups you must set (or add) "nis" to the lookup order line
in your /etc/host.conf file. Please read the manpage "resolv+.8" for
more details.
-->
ホストの名前解決に NIS を用いるには、
<filename>/etc/host.conf</filename> ファイルで解決順を指定する行に
"nis" を指定 (または追加) して下さい。
詳細に付いては resolv+(8) のマニュアルを読んで下さい。
</Para>

<Para>
<!--O
Add the following line to /etc/passwd on your NIS clients:
-->
以下の行を NIS クライアントの
<filename>/etc/passwd</filename> に追加して下さい。
</Para>

<Para>

<ProgramListing>
+::::::
</ProgramListing>

</Para>

<Para>
<!--O
You can also use the + and - characters to include/exclude or change
users. If you want to exclude the user guest just add -guest to your
/etc/passwd file.  You want to use a different shell (e.g. ksh) for
the user "linux"?  No problem, just add "+linux::::::/bin/ksh"
(without the quotes) to your /etc/passwd. Fields that you don't want
to change have to be left empty. You could also use Netgroups for
user control.
-->
+ や - といった文字を使えば、
ユーザーを追加/削除したり状態を変更したりできます。
例えばユーザ guest を削除したいなら
<filename>/etc/passwd</filename> ファイルに -guest を追加すれば OK です。
ユーザ "linux" に違ったシェル (例えば ksh) を使わせたいですって？
大丈夫、"+linux::::::/bin/ksh" を
<filename>/etc/passwd</filename> に追加するだけです (引用符は取って下さい)。
変更したくないフィールドは空のままにしておく必要があります。
ユーザのコントロールにはネットグループを用いることもできます。
</Para>

<Para>
<!--O
For example, to allow login-access only to miquels, dth and ed, and
all members of the sysadmin netgroup, but to have the account data
of all other users available use:
-->
例えば「ログインアクセスを miquiels, dth, ed とネットグループ sysadmin
のメンバーだけに限りたいが、アカウントデータは他のユーザ全員分が必要」
というような場合は以下のようになります。
</Para>

<Para>

<ProgramListing>
+miquels:::::::
+ed:::::::
+dth:::::::
+@sysadmins:::::::
-ftp
+:*::::::/etc/NoShell
</ProgramListing>

</Para>

<Para>
<!--O
Note that in Linux you can also override the password field, as we did
in this example. We also remove the login "ftp", so it isn't known any
longer, and anonymous ftp will not work.
-->
Linux ではパスワードのフィールドも上書きできることに注意して下さい。や
り方は今の例と全く同じです。この例では "ftp" のログインも
削除しています。従ってこのユーザは存在しなくなり、
anonymous ftp は機能しなくなります。
</Para>

<Para>
<!--O
The netgroup would look like
-->
<filename>/etc/netgroup</filename>
ファイルは以下のようになっていると思います。
</Para>

<ProgramListing>
sysadmins (-,software,) (-,kukuk,)
</ProgramListing>

<Para>
<!--O
IMPORTANT: The netgroup  feature is implemented starting from libc 4.5.26.
If you have a version of libc earlier than 4.5.26, every user in the
NIS password database can access your linux machine if you run "ypbind" !
-->
重要：ネットグループの機能は libc 4.5.26 から実装されました。 4.5.26 
以前の libc を使っている Linux マシンで
<command>ypbind</command> を実行すると、
NIS のパスワードデータベースにエントリを持つすべてのユーザは
そのマシンにアクセスできてしまいます！
</Para>

</Sect2>

<Sect2>
<!--O
<Title>Setting up a NIS Client using NYS
-->
<Title> NYS を用いた NIS クライアントをセットアップする
<IndexTerm><Primary
>NYS!client setup</Primary></IndexTerm>
</Title>

<Para>
<!--O
All that is required is that the NIS configuration file
(/etc/yp.conf) points to the correct server(s) for its information.
Also, the Name Services Switch configuration file (/etc/nsswitch.conf)
must be correctly set up.
-->
必要なのは NIS の設定ファイル (<filename>/etc/yp.conf</filename>)
で正しいサーバ(群)から情報をもらえるようにしておくこと、
そしてネームサービススイッチの設定ファイル
(<filename>/etc/nsswitch.conf</filename>) を正しく設定することです。
</Para>

<Para>
<!--O
You should install ypbind. It isn't needed by the libc, but the NIS(YP)
tools need it.
-->
<filename>ypbind</filename> もインストールしておきましょう。
libc には必要ありませんが、 
NIS(YP) の各ツールにはこれが必要になります。
</Para>

<Para>
<!--O
If you wish to use the include/exclude user feature (+/-guest/+@admins),
you have to use "passwd: compat" and "group: compat" in nsswitch.conf.
Note that there is no "shadow: compat"! You have to
use "shadow: files nis" in this case.
-->
ユーザの追加・排除機能 (+/-guest/+@admins) を用いたい場合は、
"passwd: compat" と "group: compat" を
<filename>nsswitch.conf</filename> で指定する必要があります。
"shadow: compat" という指定はありません。
この場合は "shadow: files nis" のようにして下さい。
</Para>

<Para>
<!--O
The NYS sources are part of the libc 5 sources. When run configure,
say the first time "NO" to the "Values correct" question,
then say "YES" to "Build a NYS libc from nys".
-->
NYS のソースは libc 5 のソースに同梱されています。 configure を実行し、 
"Values correct" の問いに対して一度目は "NO" と答えて下さい。そして
"Build a NYS libc from nys" に対して "YES" と答えて下さい。
</Para>

</Sect2>

<Sect2>
<!--O
<Title>Setting up a NIS Client using glibc 2.x
-->
<Title>glibc 2.x を用いた NIS クライアントをセットアップする
<IndexTerm><Primary
>NIS!client setup!using glibc 2.x</Primary></IndexTerm>
</Title>

<Para>
<!--O
The glibc uses "traditional NIS", so you need to start ypbind. The
Name Services Switch configuration file (/etc/nsswitch.conf) must be
correctly set up. If you use the compat mode for passwd, shadow or group,
you have to add the "+" at the end of this files and you can use
the include/exclude user feature. The configuration is excatly the same
as under Solaris 2.x.
-->
glibc は trad-NIS を利用します。従って ypbind を起動する必要があります。
またネームサービススイッチの設定ファイル
(<filename>/etc/nsswitch.conf</filename>)
も正しく設定する必要があります。
passwd/, shadow, group に 
compat モードを使う場合は、これらのファイルの最後に
"+" を追加する必要があります。
ユーザの追加・削除機能を用いることもできます。
設定は Solaris 2.x のものとまったく同じです。
</Para>

</Sect2>

<Sect2>
<!--O
<Title>The nsswitch.conf File
-->
<Title>nsswitch.conf ファイル
<IndexTerm><Primary
>nsswitch.conf file</Primary></IndexTerm>

<IndexTerm><Primary
>NIS!nsswitch.conf file</Primary></IndexTerm>
</Title>

<Para>
<!--O
The Network Services switch file /etc/nsswitch.conf determines the
order of lookups performed when a certain piece of information is
requested, just like the /etc/host.conf file which determines the way
host lookups are performed. For example, the line
-->
ネットワークサービススイッチのファイル
<filename>/etc/nsswitch.conf</filename> は、
情報へのアクセス要求が来たときに行う検索の順番を決定するものです。
ホスト名の検索で用いられる
<filename>/etc/host.conf</filename> ファイルと似ています。
例えばこのファイルにおいて
</Para>

<ProgramListing>
hosts: files nis dns
</ProgramListing>

<Para>
<!--O
specifies that host lookup functions should first look in the local
/etc/hosts file, followed by a NIS lookup and finally through the domain
name service (/etc/resolv.conf and named), at which point if no match
is found an error is returned. This file must be readable for every
user! You can find more information in the man-page nsswitch.5
or nsswitch.conf.5.
-->
と指定すれば、ホスト名の検索機能はまずローカルの
<filename>/etc/hosts</filename> ファイルを探し、
次に NIS、そしてドメインネームサービス
(<filename>/etc/resolv.conf</filename> と 
<application>named</application>) という順番で検索を行います。
最後までマッチするものがなければ、
エラーが返されることになります。このファイルは全てのユーザから
読み取り可能でなければなりません！より詳細な情報は nsswitch.5 か
nsswitch.conf.5 のマニュアルページを見てください。
</Para>

<Para>
<!--O
A good /etc/nsswitch.conf file for NIS is:
-->
NIS 用の <filename>/etc/nsswitch.conf</filename> ファイルとしては、
以下のようなものが良いでしょう。
</Para>

<ProgramListing>
#
# /etc/nsswitch.conf
#
# An example Name Service Switch config file. This file should be
# sorted with the most-used services at the beginning.
#
# The entry '[NOTFOUND=return]' means that the search for an
# entry should stop if the search in the previous entry turned
# up nothing. Note that if the search failed due to some other reason
# (like no NIS server responding) then the search continues with the
# next entry.
#
# Legal entries are:
#
#	nisplus			Use NIS+ (NIS version 3)
#	nis			Use NIS (NIS version 2), also called YP
#	dns			Use DNS (Domain Name Service)
#	files			Use the local files
#	db			Use the /var/db databases
#	[NOTFOUND=return]	Stop searching if not found so far
#

passwd:     compat
group:      compat
# For libc5, you must use shadow: files nis
shadow:     compat

passwd_compat: nis
group_compat: nis
shadow_compat: nis

hosts:      nis files dns

services:   nis [NOTFOUND=return] files
networks:   nis [NOTFOUND=return] files
protocols:  nis [NOTFOUND=return] files
rpc:        nis [NOTFOUND=return] files
ethers:     nis [NOTFOUND=return] files
netmasks:   nis [NOTFOUND=return] files
netgroup:   nis
bootparams: nis [NOTFOUND=return] files
publickey:  nis [NOTFOUND=return] files
automount:  files
aliases:    nis [NOTFOUND=return] files
</ProgramListing>

<Para>
<!--O
passwd&lowbar;compat, group&lowbar;compat and shadow&lowbar;compat are only supported by glibc 2.x.
If there are no shadow rules in /etc/nsswitch.conf, glibc will use the passwd
rule for lookups. There are some more lookup module for glibc like hesoid.
For more information, read the glibc documentation.
-->
passwd_compat, group_compat, shadow_compat は
glibc 2.x でのみサポートされています。
<filename>/etc/nsswitch.conf</filename>
に shadow ルールがなければ、
glibc はパスワードの検索に passwd ルールを用います。
glibc 用の検索モジュールとして、 hesoid のようなものも存在しています。
これについては glibc の文書を読んでください。
</Para>

</Sect2>

<Sect2>
<!--O
<Title>Shadow Passwords with NIS
-->
<Title>Shadow パスワードと NIS
<IndexTerm><Primary
>NIS!shadow passwords</Primary></IndexTerm>
</Title>

<Para>
<!--O
Shadow passwords over NIS are always a bad idea. You loose the security,
which shadow gives you, and it is supported by only some few Linux C
Libraries. A good way to avoid shadow passwords over NIS is,
to put only the local system users in /etc/shadow. Remove the NIS user
entries from the shadow database, and put the password back in passwd.
So you can use shadow for the root login, and normal passwd for NIS
user. This has the advantage that it will work with every NIS client.
-->
NIS に shadow パスワードを流通させるのは良い考えではありません。
shadow システムのメリットであるセキュリティが失われてしまうからです。
それにこれがサポートされている Linux C ライブラリは少数に過ぎません。
NIS 上に shadow を流さないようにするには、
ローカルシステムのユーザだけを
<filename>/etc/shadow</filename> に登録することです。
NIS に流すユーザエントリを shadow データベースから削除し、
それらのパスワードは passwd に書いて下さい。
こうすれば root ログインには shadow を、
一般の NIS ユーザには passwd を用いることができるようになります。
この方法なら、すべての NIS クライアントでうまく動作します。
</Para>

<Sect3>
<Title>Linux</Title>

<Para>
<!--O
The only Linux libc which supports shadow passwords over NIS, is the
GNU C Library 2.x. Linux libc5 has no support for it. Linux
libc5 compiled with NYS enabled has some code for it. But this code
is badly broken in some cases and doesn't work with all correct
shadow entries.
-->
NIS で shadow パスワードを用いることができる唯一の Linux libc は
GNU C Library 2.x です。 Linux libc5 はこれをサポートしていません。
Linux libc5 を NYS と一緒にコンパイルした場合は、
多少のコードが含まれることにはなります。
でもこのコードは状況によってはひどく壊れてしまい、
shadow エントリが全て正しい場合でも動作しないことがあります。
</Para>

</Sect3>

<Sect3>
<Title>Solaris</Title>

<Para>
<!--O
Solaris does not support shadow passwords over NIS.
-->
Solaris は NIS 上での shadow パスワードをサポートしていません。
</Para>

</Sect3>

<Sect3>
<Title>PAM
<IndexTerm><Primary
>PAM!shadow passwords</Primary></IndexTerm>
</Title>

<Para>
<!--O
PAM does not support Shadow passwords over NIS, especially
pam&lowbar;pwdb/libpwdb. This is a big problem for RedHat 5.x users. If you
have glibc and PAM, you need to change the /etc/pam.d/* entries.
Replace all pam&lowbar;pwdb rules through pam&lowbar;unix&lowbar;*
modules. Due a bug in the pam&lowbar;unix&lowbar;auth.so module this will not always
work.
-->
PAM は NIS 上での shadow パスワードをサポートしません。
特に pam_pwdb/libpwdb がだめなんです。
これは RedHat 5.x ユーザにとって大きな問題です。
glibc と PAM を使っている場合は、
/etc/pam.d/* のエントリを変更する必要があります。
pam_unix_* モジュールにある
pam_pwdb のルールを置き換えて下さい。
しかし pam_unix_auth.so モジュールにはバグがあるので、
これは必ず動作するとは限りません。
</Para>

<Para>
<!--O
An example /etc/pam.d/login file looks like:
-->
<filename>/etc/pam.d/login</filename> の例を以下にあげます。
</Para>

<ProgramListing>
#%PAM-1.0
auth       required	/lib/security/pam_securetty.so
auth       required	/lib/security/pam_unix.so
auth       required	/lib/security/pam_nologin.so
account    required	/lib/security/pam_unix.so
password   required	/lib/security/pam_unix.so
session    required	/lib/security/pam_unix.so
</ProgramListing>

</Sect3>

</Sect2>

</Sect1>

<Sect1 id="nisplus-setup">
<!--O
<Title>What do you need to set up NIS+ ?</Title>
-->
<Title>NIS+ の設定</Title>

<Sect2>
<!--O
<Title>The Software
-->
<Title>ソフトウェア
<IndexTerm><Primary
>NIS+!software required</Primary></IndexTerm>
</Title>

<Para>
<!--O
The Linux NIS+ client code was developed for the GNU C library 2.
There is also a port for Linux libc5, since most commercial Applications
are linked against this library, and you cannot recompile them for
using glibc. There are problems with libc5 and NIS+:
static programs cannot be linked with it, and programs compiled
with this library will
not work with other libc5 versions.
-->
Linux の NIS+ クライアントコードは GNU C ライブラリのバージョン 2 用に
開発されてきました。これを libc5 へ移植したものもあります。
商用アプリケーションのほとんどは libc5 にリンクされていますし、
これらアプリケーションを glibc 向けに再コンパイルすることはできませんから。
ただし libc5 と NIS+ を同時に使う際には問題があります。
スタティックなプログラムは libc5 にリンクすることはできませんし、
このライブラリでコンパイルしたプログラムは
他のバージョンの libc5 では動作しません。
</Para>

<Para>
<!--O
You need to retrieve and compile the GNU C Library 2.1 for Intel
based platforms, or GNU C Library 2.1.1 for 64bit platforms.
As base System you need a glibc based Distribution like Debian,
RedHat or SuSE Linux.
-->
GNU C Library 2.1 を手に入れ、コンパイルする必要があります。
64bit プラットフォームなら GNU C Library 2.1.1 です。
ベースのシステムとして、 glibc ベースの配布パッケージも
必要になります。 Debian, RedHat, SuSE Linux などです。
</Para>

<Para>
<!--O
For every distribution, you need to recompile the gcc/g++ compiler,
libstdc++ and ncures. For Redhat, you need to make a lot of
changes of the PAM configuration. For SuSE Linux 6.0, you need
to recompile the shadow package.
-->
どのディストリビューションでも、 gcc/g++ コンパイラ、
libstdc++, ncurses を再コンパイルしなければなりません。
Redhat では PAM の設定を大幅に変更しなければなりません。
SuSE Linux 6.0 では
shadow パッケージを再コンパイルしなければなりません。
</Para>

<Para>
<!--O
The NIS+ client software can be obtained from:
-->
NIS+ クライアントのソフトウェアは以下から入手できます。
</Para>

<!--O
<Screen>
  Site             Directory                     File Name

  ftp.funet.fi     /pub/gnu/funet                libc-*, glibc-crypt-*,
                                                 glibc-linuxthreads-*
  ftp.kernel.org   /pub/linux/utils/net/NIS+     nis-utils-1.3.tar.gz
</Screen>
-->
<InformalTable frame=none>
<tgroup cols=2>
<thead>
<row>
 <entry>Site and Directory</entry>
 <entry>Filename</entry>
</row>
</thead>
<tbody>
<row>
 <entry morerows=2><ULink URL="ftp://ftp.funet.fi/pub/gnu/funet/"
  >ftp.funet.fi:/pub/gnu/funet</ULink></entry>
 <entry>libc-*</entry>
</row>
<row><entry>glibc-crypt-*</entry></row>
<row><entry>glibc-linuxthreads-*</entry></row>

<row>
 <entry><ULink URL="ftp://ftp.kernel.org/pub/linux/utils/net/NIS+/"
  >ftp.kernel.org:/pub/linux/utils/net/NIS+</ULink></entry>
 <entry>nis-utils-1.3.tar.gz</entry>
</row>
</tbody>
</tgroup>
</InformalTable>

<Para>
<!--O
You should also have a look at
<ULink
URL="http://www.suse.de/~kukuk/nisplus/"
>http://www.suse.de/~kukuk/nisplus/</ULink
>
for more information and the latest sources.
-->
<ULink URL="http://www.suse.de/~kukuk/nisplus/"
>http://www.suse.de/~kukuk/nisplus/</ULink>
には、より詳細な情報と最新のソースがあります。
</Para>

</Sect2>

<Sect2>
<!--O
<Title>Setting up a NIS+ client
-->
<Title>NIS+ クライアントのセットアップ
<IndexTerm><Primary
>NIS+!client setup</Primary></IndexTerm>
</Title>

<Para>
<!--O
IMPORTANT: For setting up a NIS+ client read your Solaris NIS+ docs
what to do on the server side! This document only describes what to do
on the client side!
-->
重要： NIS+ クライアントをセットアップする前に、 Solaris の NIS+ ドキュ
メントを読んでサーバ側で必要な作業を行って下さい。この文書ではクライア
ント側でどうすればよいかについてしか述べていません！
</Para>

<Para>
<!--O
After installing the new libc and nis-tools, create the credentials for
the new client on the NIS+ server. Make sure portmap is running. Then
check if your Linux PC has the same time as the NIS+ Server. For secure RPC,
you have only a small window from about 3 minutes, in which the credentials
are valid. A good idea is to run xntpd on every host. After this, run
-->
新しい libc と nis-tools をインストールしたら、
NIS+ サーバ上でこの新たなクライアント用の信任証 (credential) を作成します。
portmap が動作していることを確認するようにして下さい。
次にクライアントにする Linux PC の時刻が
NIS+ サーバと一致しているかチェックして下さい。
secure RPC の場合は、信任証の有効期間は
3 分しかありません。すべてのホストで
<application>xntpd</application> を走らせるのが良いでしょう。
これらが確認できたら以下を実行します。
</Para>

<Para>

<Screen>
domainname nisplus.domain.
nisinit -c -H &#60;NIS+ server&#62;
</Screen>

</Para>

<Para>
<!--O
to initialize the cold start file. Read the nisinit man page for more
options. Make sure that the domainname will always be set after a reboot.
If you don't know what the NIS+ domain name is on your network, ask
your system/network administrator.
-->
これによって cold スタートファイルが初期化されます。
他のオプションについては
<command>nisinit</command> のマニュアルページを読んで下さい。
ドメインネームはリブートのたびに設定されるようにしておいて下さい。
あなたのネットワークの NIS+ ドメインネームがわからない場合は、
システムかネットワークの管理者に尋ねて下さい。
</Para>

<Para>
<!--O
Now you should change your /etc/nsswitch.conf file. Make sure that the
only service after publickey is nisplus ("publickey: nisplus"), and nothing
else!
-->
次に <filename>/etc/nsswitch.conf</filename> ファイルを変更します。
publickey に書けるサービスは nisplus だけ ("publickey: nisplus") で、
他のものは書いてはならないことに注意して下さい。
</Para>

<Para>
<!--O
Then start keyserv and make sure, that it will always be started
as first daemon after portmap at boot time. Run
-->
次に <command>keyserv</command> を起動して下さい。これはブート時に、
必ず portmap の直後に起動されるようにしておいて下さい。こうして

<Screen>
keylogin -r
</Screen>

<!--O
to store the root secretkey on your system. (I hope you have added the
publickey for the new host on the NIS+ Server?).
-->
とすればシステムの root の秘密鍵が保管されます
(もうこの新しいホストの公開鍵は NIS+ のサーバに追加しましたよね？)。
</Para>

<Para>
<!--O
"niscat passwd.org&lowbar;dir" should now show you all entries in the passwd database.
-->
<command>niscat passwd.org_dir</command>
とすれば、
passwd データベースのすべてのエントリを見ることができるはずです。
</Para>

</Sect2>

<Sect2>
<!--O
<Title>NIS+, keylogin, login and PAM
-->
<Title>NIS+, keylogin, login および PAM
<IndexTerm><Primary
>NIS+!use of PAM with</Primary></IndexTerm>
</Title>

<Para>
<!--O
When the user logs in, he need to set his secretkey to keyserv. This is done
by calling "keylogin". The login from the shadow package will do this for the
user, if it was compiled against glibc 2.1. For a PAM aware login, you have
to change the /etc/pam.d/login file to
use pam&lowbar;unix2, not pwdb, which doesn't support NIS+. An example:
-->
ログインしたときに、ユーザは自分の秘密鍵を
<application>keyserv</application> にセットする必要があります。
これには <command>keylogin</command> を用います。 
glibc 2.1 とコンパイルされた場合には、 shadow パッケージの
<command>login</command> はこれをユーザの代わりに実行してくれます。
PAM を認識する <command>login</command> を用意するには、 
<filename>pam_keylogin-1.2.tar.gz</filename> をインストールし、 
<filename>/etc/pam.d/login</filename> ファイルを変更して pwdb の代わりに 
pam&_unix_auth を使うようにする必要があります
(pwdb は NIS+ をサポートしません)。例を示します。
</Para>

<Para>

<ProgramListing>
#%PAM-1.0
auth       required	/lib/security/pam_securetty.so
auth       required	/lib/security/pam_unix2.so       set_secrpc
auth       required	/lib/security/pam_nologin.so
account    required	/lib/security/pam_unix2.so
password   required	/lib/security/pam_unix2.so
session    required	/lib/security/pam_unix2.so
</ProgramListing>

</Para>

</Sect2>


<Sect2>
<!--O
<Title>The nsswitch.conf File
-->
<Title>nsswitch.conf ファイル
<IndexTerm><Primary
>nsswitch.conf file</Primary></IndexTerm>

<IndexTerm><Primary
>NIS+!nsswitch.conf file</Primary></IndexTerm>
</Title>

<Para>
<!--O
The Network Services switch file /etc/nsswitch.conf determines the
order of lookups performed when a certain piece of information is
requested, just like the /etc/host.conf file which determines the way
host lookups are performed. For example, the line
-->
ネットワークサービススイッチのファイル
<filename>/etc/nsswitch.conf</filename> は、
情報へのアクセス要求が来たときに行う検索の順番を決定するものです。
ホスト名の検索で用いられる
<filename>/etc/host.conf</filename> ファイルと似ています。
例えばこのファイルにおいて
</Para>

<Para>

<ProgramListing>
hosts: files nisplus dns
</ProgramListing>

</Para>

<Para>
<!--O
specifies that host lookup functions should first look in the local
/etc/hosts file, followed by a NIS+ lookup and finally through the domain
name service (/etc/resolv.conf and named), at which point if no match
is found an error is returned.
-->
と指定すれば、ホスト名の検索機能はまずローカルの
<filename>/etc/hosts</filename> 
ファイルを探し、次に NIS+、そしてドメインネームサービス
(<filename>/etc/resolv.conf</filename> と <application>named</application>)
と言う順番で検索を行います。
最後までマッチするものがなければエラーが返されることになります。
</Para>

<Para>
<!--O
A good /etc/nsswitch.conf file for NIS+ is:
-->
NIS+ 用の <filename>/etc/nsswitch.conf</filename> ファイルは、
以下のようなものにしておけば良いでしょう。
</Para>

<ProgramListing>
#
# /etc/nsswitch.conf
#
# An example Name Service Switch config file. This file should be
# sorted with the most-used services at the beginning.
#
# The entry '[NOTFOUND=return]' means that the search for an
# entry should stop if the search in the previous entry turned
# up nothing. Note that if the search failed due to some other reason
# (like no NIS server responding) then the search continues with the
# next entry.
#
# Legal entries are:
#
#	nisplus			Use NIS+ (NIS version 3)
#	nis			Use NIS (NIS version 2), also called YP
#	dns			Use DNS (Domain Name Service)
#	files			Use the local files
#	db			Use the /var/db databases
#	[NOTFOUND=return]	Stop searching if not found so far
#

passwd:     compat
group:      compat
shadow:     compat

passwd_compat: nisplus
group_compat:  nisplus
shadow_compat: nisplus

hosts:      nisplus files dns

services:   nisplus [NOTFOUND=return] files
networks:   nisplus [NOTFOUND=return] files
protocols:  nisplus [NOTFOUND=return] files
rpc:        nisplus [NOTFOUND=return] files
ethers:     nisplus [NOTFOUND=return] files
netmasks:   nisplus [NOTFOUND=return] files
netgroup:   nisplus
bootparams: nisplus [NOTFOUND=return] files
publickey:  nisplus
automount:  files
aliases:    nisplus [NOTFOUND=return] files
</ProgramListing>

</Sect2>

</Sect1>

<Sect1 id="ypserv">
<!--O
<Title>Setting up a NIS Server
-->
<Title>NIS サーバの設定
<IndexTerm><Primary
>NIS!server setup</Primary></IndexTerm>
</Title>

<Sect2>
<!--O
<Title>The Server Program ypserv
-->
<Title>サーバプログラム ypserv
<IndexTerm><Primary
>ypserv!setup</Primary></IndexTerm>

<IndexTerm><Primary
>NIS!ypserv setup</Primary></IndexTerm>
</Title>

<Para>
<!--O
This document only describes how to set up the "ypserv" NIS server.
-->
この文書では、 NIS サーバとしては "ypserv" の
設定方法のみを記します。
</Para>

<Para>
<!--O
The NIS server software can be found on:
-->
NIS サーバのソフトは以下にあります。
</Para>

<!--O
<Screen>
  Site               Directory                    File Name

  ftp.kernel.org     /pub/linux/utils/net/NIS     ypserv-1.3.11.tar.gz
</Screen>
-->
<InformalTable frame=none>
<tgroup cols=2>
<thead>
<row>
 <entry>Site and Directory</entry>
 <entry>Filename</entry>
</row>
</thead>
<tbody>
<row>
 <entry morerows=2><ULink URL="ftp://ftp.kernel.org/pub/linux/utils/net/NIS/"
  >ftp.kernel.org:/pub/linux/utils/net/NIS</ULink></entry>
 <entry>ypserv-1.3.11.tar.gz</entry>
</row>
</tbody>
</tgroup>
</InformalTable>

<Para>
<!--O
You could also look at
<ULink
URL="http://www.suse.de/~kukuk/nis/"
>http://www.suse.de/~kukuk/nis/</ULink
>
for more information.
-->
<ULink
URL="http://www.suse.de/~kukuk/nis/"
>http://www.suse.de/~kukuk/nis/</ULink
>
に、より詳しい情報があります。
</Para>

<Para>
<!--O
The server setup is the same for both traditional NIS and NYS.
-->
サーバのセットアップ方法は trad-NIS / NYS どちらの場合でも同じです。
</Para>

<Para>
<!--O
Compile the software to generate the <Literal remap="tt">ypserv</Literal> and <Literal remap="tt">makedbm</Literal>
programs. You can configure ypserv to use the securenets file or
the tcp&lowbar;wrappers. The tcp&lowbar;wrapper is much more flexible, but a lot of
people have big problems with it. And some configuration files for
tcp&lowbar;wrappers may cause a memory leak. If you have problems with
ypserv compiled for tcp&lowbar;wrapper, recompile it using the securenets file.
ypserv -\-version tells you, which version you have.
-->
コンパイルして <filename>ypserv</filename> と
<filename>makedbm</filename> を作ります。
<filename>securenets</filename> ファイルを使うか
<application>tcp_wrapper</application> を使うかを設定できます。
<application>tcp_wrapper</application> の方がずっと柔軟ですが、
これが問題の原因となる場合も多く知られています。
<application>tcp_wrapper</application>
は設定ファイルの書き方によってはメモリーリークを起こすこともあります。
もし <application>tcp_wrapper</application> を使うように
<application>ypserv</application> をコンパイルして問題が起こった場合には、
<filename>securenets</filename> ファイルを
用いるようにコンパイルしなおしてください。
<command>ypserv <option>--version</option></command> とすれば
どちらのバージョンを使っているか分かります。
</Para>

<Para>
<!--O
If you run your server as master, determine what files you require to be
available via NIS and then add or remove the appropriate
entries to the "all" rule in <Literal remap="tt">/var/yp/Makefile</Literal>. You always
should look at the Makefile and edit the Options at the beginning of
the file.
-->
サーバをマスターとして起動する場合は、
NIS を用いて共有させるファイルを決めてください。
そして <filename>/var/yp/Makefile</filename> の
"all" ルールに必要なものを加えたり、不要なものを削除したりしてください。
また Makefile の先頭の方も必ず見て、
オプションを自分の環境にあわせて編集しておくべきです。
</Para>

<Para>
<!--O
There was one big change between ypserv 1.1 and ypserv 1.2. Since
version 1.2, the file handles are cached. This means you have to
call makedbm always with the -c option if you create new maps. Make
sure, you are using the
new <Literal remap="tt">/var/yp/Makefile</Literal> from ypserv 1.2 or later, or add the -c flag
to makedbm in the Makefile. If you don't do that, ypserv will continue to
use the old maps, and not the updated one.
-->
ypserv 1.1 と ypserv 1.2 との間では、大きな変更が行われました。
1.2 以降では、ファイルハンドルがキャッシュされるようになったのです。
これにより、新しいマップを生成するときには必ず makedbm に -c
オプションをつけなければならなくなりました。
<filename>/var/yp/Makefile</filename> が
ypserv 1.2 以降に付属のものであることを確認して下さい。
あるいは Makefile 中の makedbm に、手で -c フラグを加えて下さい。
これを忘れると、ypserv は更新されたマップではなく、
古いマップを使い続けてしまいます。
</Para>

<Para>
<!--O
Now edit <Literal remap="tt">/var/yp/securenets</Literal> and <Literal remap="tt">/etc/ypserv.conf</Literal>.
For more information, read the ypserv(8) and ypserv.conf(5) manual pages.
-->
次に <filename>/var/yp/securenets</filename> と
<filename>/etc/ypserv.conf</filename> を編集します。
詳細は ypserv(8) と ypserv.conf(5) のマニュアルページを読んで下さい。
</Para>

<Para>
<!--O
Make sure the portmapper (portmap(8)) is running, and start the
server <Literal remap="tt">ypserv</Literal>. The command
-->
ポートマッパ (<command>rpc.portmap</command>) が動いているか確認して下さい。
確認できたら <command>ypserv</command> を動かします。
</Para>

<Para>

<Screen>
% rpcinfo -u localhost ypserv
</Screen>

</Para>

<Para>
<!--O
should output something like
-->
というコマンドを実行してみて、

<Screen>
program 100004 version 1 ready and waiting
program 100004 version 2 ready and waiting
</Screen>

と出力されることを確認して下さい。
</Para>

<Para>
<!--O
The "version 1" line could be missing, depending on the ypserv version and
configuration you are using. It is only necessary if you have old
SunOS 4.x clients.
-->
"version 1" の行は、 ypserv のバージョンや用いた設定によっては
出ないかもしれません。これが必要になるのは昔の SunOS 4.x を
クライアントとして使う場合だけです。
</Para>

<Para>
<!--O
Now generate the NIS (YP) database. On the master, run
-->
ここで NIS (YP) データを作成します。
マスターサーバで以下を実行して下さい。
</Para>

<Para>

<Screen>
% /usr/lib/yp/ypinit -m
</Screen>

</Para>

<Para>
<!--O
On a slave make sure that <Literal remap="tt">ypwhich -m</Literal> works. This means,
that your slave
must be configured as NIS client before you could run
-->
スレーブサーバでは、
<command>ypwhich <option>-m</option></command>
が機能することを確認して下さい。
つまりスレーブにするホストは、まず NIS クライアントとして動作できなけ
ればならないのです。
確認できたら以下を実行して、このホストを NIS スレーブにします。
</Para>

<Screen>
% /usr/lib/yp/ypinit -s masterhost
</Screen>

<!--O
to install the host as NIS slave.
-->

<Para>
<!--O
That's it, your server is up and running.
-->
これでおしまい、サーバは動作しているはずです。
</Para>

<Para>
<!--O
If you have bigger problems, you could start <Literal remap="tt">ypserv</Literal> and
<Literal remap="tt">ypbind</Literal> in debug
mode on different xterms. The debug output should show you what goes
wrong.
-->
何か大きな問題が生じたら、
<command>ypserv</command> や <command>ypbind</command>
を別の xterm からデバッグモードで起動してみましょう。
デバッグ出力から何が問題なのかが判断できるはずです。
</Para>

<Para>
<!--O
If you need to update a map, run <Literal remap="tt">make</Literal> in the <Literal remap="tt">/var/yp</Literal>
directory on the NIS master. This will update a map if the source file
is newer, and push the files to the slave servers. Please don't use
<Literal remap="tt">ypinit</Literal> for updating a map.
-->
マップを更新する必要が生じた場合は、 NIS マスターの
<filename>/var/yp</filename> ディレクトリで
<command>make</command> を実行してください。
ソースファイルが新しい場合にはマップが更新され、スレーブサーバに
push されます。マップの更新には
<command>ypinit</command>
は用いないようにしてください。
</Para>

<Para>
<!--O
You might want to edit root's crontab *on the slave* server and add the
following lines:
-->
「スレーブ」サーバ上では root の
<filename>crontab</filename> を編集し、
以下のような行を追加しておくと良いかもしれません。
</Para>

<ProgramListing>
20 *    * * *    /usr/lib/yp/ypxfr_1perhour
40 6    * * *    /usr/lib/yp/ypxfr_1perday
55 6,18 * * *    /usr/lib/yp/ypxfr_2perday
</ProgramListing>

<Para>
<!--O
This will ensure that most NIS maps are kept up-to-date, even if an
update is missed because the slave was down at the time the update was
done on the master.
-->
万が一マスタサーバでの更新の際にスレーブがダウンしていてデータを
受け損なっても，これによって NIS マップを最新に保つことができます。
</Para>

<Para>
<!--O
You can add a slave at every time later. At first, make sure that
the new slave server has permissions to contact the NIS master. Then run
-->
スレーブはいつでも追加することができます。
まず新しくインストールしたスレーブサーバが
NIS マスターに接続する許可を持っているかを確認しましょう。
次に

<Screen>
% /usr/lib/yp/ypinit -s masterhost
</Screen>

<!--O
on the new slave. On the master server, add the new slave server name
to <Literal remap="tt">/var/yp/ypservers</Literal> and run <Literal remap="tt">make</Literal> in <Literal remap="tt">/var/yp</Literal>
to update the map.
-->
を新しいスレーブで実行します。
マスターサーバでは、この新しいスレーブサーバの名前を
<filename>/var/yp/ypservers</filename> に追加し、
<filename>/var/yp</filename>
で
<command>make</command>
を実行してマップを更新します。
</Para>

<Para>
<!--O
If you want to restrict access for users to your NIS server, you'll have
to setup the NIS server as a client as well by running ypbind and adding the
plus-entries to /etc/passwd &lowbar;halfway&lowbar; the password file. The library
functions will ignore all normal entries after the first NIS entry, and
will get the rest of the info through NIS. This way the NIS access rules
are maintained. An example:
-->
NIS サーバへのユーザアクセスを制限したい場合は、
NIS サーバのホストをクライアントとしても実行する必要があります。
つまり <command>ypbind</command> を実行して
"+" の付いたエントリをパスワードファイル <filename>/etc/passwd</filename>
の半ばに追加します。
ライブラリ関数は NIS エントリ以降に置かれた通常のエントリを全て無視し、
残りを NIS を通して取得します。このようにすると NIS のアクセスルールを
管理することができます。例を示します。
</Para>

<Para>

<ProgramListing>
root:x:0:0:root:/root:/bin/bash
daemon:*:1:1:daemon:/usr/sbin:
bin:*:2:2:bin:/bin:
sys:*:3:3:sys:/dev:
sync:*:4:100:sync:/bin:/bin/sync
games:*:5:100:games:/usr/games:
man:*:6:100:man:/var/catman:
lp:*:7:7:lp:/var/spool/lpd:
mail:*:8:8:mail:/var/spool/mail:
news:*:9:9:news:/var/spool/news:
uucp:*:10:50:uucp:/var/spool/uucp:
nobody:*:65534:65534:noone at all,,,,:/dev/null:
+miquels::::::
+:*:::::/etc/NoShell
[ All normal users AFTER this line! ]
tester:*:299:10:Just a test account:/tmp:
miquels:1234567890123:101:10:Miquel van Smoorenburg:/home/miquels:/bin/zsh
</ProgramListing>

</Para>

<Para>
<!--O
Thus the user "tester" will exist, but have a shell of /etc/NoShell. miquels
will have normal access.
-->
このようにユーザ "tester" は存在しますが、シェルが /etc/NoShell
になります。 miquels は通常のアクセス権を持つことになります。
</Para>

<Para>
<!--O
Alternatively, you could edit the <Literal remap="tt">/var/yp/Makefile</Literal> file
and set NIS to use
another source password file. On large systems the NIS password and group
files are usually stored in <Literal remap="tt">/etc/yp/</Literal>. If you do this the normal
tools to administrate the password file such as <Literal remap="tt">passwd</Literal>, <Literal remap="tt">chfn</Literal>,
<Literal remap="tt">adduser</Literal> will not work anymore and you need special homemade tools
for this.
-->
あるいは <filename>/var/yp/Makefile</filename>
ファイルを編集し、
NIS が使うパスワードファイルを別に指定することができます。
大きなシステムでは、NIS のパスワードファイルとグループファイルは通常
<filename>/var/yp/ypfiles</filename> 
に置くことが多いようです。
このようにするとパスワードファイル関連の管理ツールは使えなくなります。
つまり
<command>passwd</command>,
<command>chfn</command>,
<command>adduser</command>
などに対し、特別なツールが必要になります。
</Para>

<Para>
<!--O
However, <Literal remap="tt">yppasswd</Literal>, <Literal remap="tt">ypchsh</Literal> and <Literal remap="tt">ypchfn</Literal> will
work of course.
-->
しかし
<command>yppasswd</command>,
<command>ypchsh</command>,
<command>ypchfn</command>
は当然動作します。
</Para>

</Sect2>

<Sect2>
<!--O
<Title>The Server Program yps
-->
<Title>サーバプログラム yps
<IndexTerm><Primary
>NIS!yps server</Primary></IndexTerm>

<IndexTerm><Primary
>yps NIS server</Primary></IndexTerm>
</Title>

<Para>
<!--O
To set up the "yps" NIS server please refer to the previous paragraph.
The "yps" server setup is similar, &lowbar;but&lowbar; not exactly the same so
beware if you try to apply the "ypserv" instructions to "yps"!
"yps" is not supported by any author, and contains some security leaks.
You really shouldn't use it !
-->
NIS サーバ <application>yps</application> の設定は
前のセクションを参考にして下さい。
大体似ていますが完全に同じではないので、
<application>ypserv</application> の説明を適用する際には注意して下さい。
<application>yps</application> はもはや誰もサポートしていませんし、
いくつかセキュリティホールも存在しています。使うべきではありません！
</Para>

<Para>
<!--O
The "yps" NIS server software can be found on:
-->
<application>yps</application> のソフトは以下のサイトにあります。
</Para>

<!--O
<Screen>
  Site                  Directory                   File Name

  ftp.lysator.liu.se    /pub/NYS/servers            yps-0.21.tar.gz
  ftp.kernel.org        /pub/linux/utils/net/NIS    yps-0.21.tar.gz
</Screen>
-->
<InformalTable frame=none>
<tgroup cols=2>
<thead>
<row>
 <entry>Site and Directory</entry>
 <entry>Filename</entry>
</row>
</thead>
<tbody>
<row>
 <entry morerows=2><ULink URL="ftp://ftp.lysator.liu.se/pub/NYS/servers/"
  >ftp.lysator.liu.se:/pub/NYS/servers</ULink></entry>
 <entry>yps-0.21.tar.gz</entry>
</row>
<row>
 <entry morerows=2><ULink URL="ftp://ftp.kernel.org/pub/linux/utils/net/NIS/"
  >ftp.kernel.org:/pub/linux/utils/net/NIS</ULink></entry>
 <entry>yps-0.21.tar.gz</entry>
</row>
</tbody>
</tgroup>
</InformalTable>

</Sect2>

<Sect2>
<!--O
<Title>The Program rpc.ypxfrd
-->
<Title>rpc.ypxfrd プログラム
<IndexTerm><Primary
>NIS&verbar;rpc.ypxfrd daemon</Primary></IndexTerm>

<IndexTerm><Primary
>rpc.ypxfrd daemon</Primary></IndexTerm>
</Title>

<Para>
<!--O
rpc.ypxfrd is used for speed up the transfer of very large
NIS  maps  from a NIS master to NIS slave servers. If a
NIS slave server receives a message that there is  a  new
map,  it  will  start  ypxfr  for transfering the new map.
ypxfr will read the contents of  a  map  from  the  master
server  using the yp&lowbar;all() function. This process can take
several minutes when there are very large maps which  have
to store by the database library.
-->
rpc.ypxfrd は非常に大きな NIS マップを NIS マスターから
NIS スレーブサーバーに転送する際に、転送を高速化するために
用いられます。
NIS スレーブサーバーは、新しいマップがあるというメッセージを
受け取ると、そのマップを取得するために ypxfr を起動します。
ypxfr は yp_all() 関数を用いてマップの内容をマスターサーバー
から読み込もうとします。この情報はデーターベースライブラリを
通して保存されるため、マップのサイズが非常に大きくなると、
このプロセスは数分もかかってしまうことがあります。
</Para>

<Para>
<!--O
The  rpc.ypxfrd  server  speeds up the transfer process by
allowing NIS slave  servers  to  simply  copy  the  master
server's  map  files  rather  than building their own from
scratch.  rpc.ypxfrd uses an RPC-based file transfer  protocol,
so that there is no need for building a new map.
-->
rpc.ypxfrd サーバーは、 NIS スレーブサーバーにマスターの
マップファイルを単純にコピーさせ、転送プロセスを高速化します。
スレーブサーバーがゼロから自前のマップを生成するのに比べ、
これはずっと短時間ですみます。
rpc.ypxfrd は RPC ベースの転送プロトコルを用いるので、
新しいマップを生成する必要はありません。
</Para>

<Para>
<!--O
rpc.ypxfrd can be started by inetd. But since it starts
very slow, it should be started with ypserv. You need to start
rpc.ypxfrd only on the NIS master server.
-->
rpc.ypxfrd は inetd から起動することもできますが、
起動には時間がかかるので、 ypserv と一緒にデーモンとして
起動しておくほうがいいでしょう。
rpc.ypxfrd は NIS マスターサーバでだけ起動しておけば OK です。
</Para>

</Sect2>

<Sect2>
<!--O
<Title>The Program rpc.yppasswdd
-->
<Title>rpc.yppasswdd プログラム
<IndexTerm><Primary
>NIS!rpc.yppasswdd daemon</Primary></IndexTerm>

<IndexTerm><Primary
>rpc.yppasswdd daemon</Primary></IndexTerm>
</Title>

<Para>
<!--O
Whenever users change their passwords, the NIS password database and
probably other NIS databases, which depend on the NIS password
database, should be updated.  The program "rpc.yppasswdd" is a server that
handles password changes and makes sure that the NIS information will
be updated accordingly. rpc.yppasswdd is now integrated in ypserv. You
don't need the older, separate yppasswd-0.9.tar.gz or yppasswd-0.10.tar.gz,
and you shouldn't use them any longer. The rpc.yppasswdd in ypserv 1.3.2
has full shadow support. yppasswd is now part of yp-tools-2.2.tar.gz.
-->
ユーザがパスワードを変更したときには、
NIS のパスワードデータベースや、
それに依存した他の NIS データベースも変更されなければなれません。
これを行なうのが <command>rpc.yppasswdd</command> です。
このプログラムはパスワード変更を取り扱い、
NIS の情報が正しく更新されるようにします。
現在 <command>rpc.yppasswdd</command> は
<application>ypserv</application> の一部となっています。
別パッケージになっている
<filename>yppasswd-0.9.tar.gz</filename> や
<filename>yppasswd-0.10.tar.gz</filename>
などは古いので使う必要はありませんし、また今後使うべきではありません。 
ypserv 1.3.2 の <command>rpc.yppasswdd</command> は
shadow を完全にサポートしています。
<command>yppasswd</command> は
<filename>yp-tools-2.2.tar.gz</filename> に入っています。 
</Para>

<Para>
<!--O
You need to start rpc.yppasswdd only on the NIS master server. By default,
users are not allowed to change their full name or the login shell.
You can allow this with the -e chfn or -e chsh option.
-->
rpc.yppasswdd を実行するのは NIS マスターサーバのみです。デフォルトで
は、ユーザーはフルネームやログインシェルを変更することができないように
なっています。これを許可するには、それぞれ -e chfn および -e chsh オプ
ションを指定します。
</Para>

<Para>
<!--O
If your passwd and shadow files are not in another directory then
/etc, you need to add the -D option. For example, if you have put
all source files in /etc/yp and wish to allow the user to change
his shell, you need to start rpc.yppasswdd with the following parameters:
-->
passwd と shadow ファイルが /etc 以外にある場合は、 -D オプションを
指定する必要があります。例えば全てのソースファイルを
<filename>/etc/yp</filename>
に置いて、ユーザにシェルの変更を可能にしたい場合は、
<command>rpc.yppasswdd</command> を以下のパラメータで実行しなければなりません:

<Screen>
# rpc.yppasswdd -D /etc/yp -e chsh
</Screen>

<!--O
or
-->
または

<Screen>
# rpc.yppasswdd -s /etc/yp/shadow -p /etc/yp/passwd -e chsh
</Screen>

でも OK です。
</Para>

<Para>
<!--O
There is nothing more to do. You just need to make sure, that
<Literal remap="tt">rpc.yppasswdd</Literal> uses the same files as <Literal remap="tt">/var/yp/Makefile</Literal>.
Errors will be logged using syslog.
-->
他には特にすることはありません。ただ、
<command>rpc.yppasswdd</command> が
<filename>/var/yp/Makefile</filename>
と同じファイルを使っているかどうかは気をつけておいてください。
エラーは syslog を通して記録されます。
</Para>

</Sect2>

</Sect1>

<Sect1 id="verify-inst">
<!--O
<Title>Verifying the NIS/NYS Installation
-->
<Title>NIS/NYS インストールのチェック
<IndexTerm><Primary
>NIS!verification of operation</Primary></IndexTerm>

<IndexTerm><Primary
>NYS!verification of operation</Primary></IndexTerm>
</Title>

<Para>
<!--O
If everything is fine (as it should be), you should be able to verify
your installation with a few simple commands. Assuming, for example,
your passwd file is being supplied by NIS, the command
-->
すべてがうまく行ったら、
簡単なコマンドを使ってインストールのチェックを行って下さい。
例えばパスワードファイルが NIS/NYS で共有されている場合は、
</Para>

<Para>

<Screen>
% ypcat passwd
</Screen>

</Para>

<Para>
<!--O
should give you the contents of your NIS passwd file. The command
-->
というコマンドで NIS のパスワードファイルの内容が見られるはずです。
また
</Para>

<Para>

<Screen>
% ypmatch userid passwd
</Screen>

</Para>

<Para>
<!--O
(where userid is the login name of an arbitrary user) should give you
the user's entry in the NIS passwd file. The "ypcat" and "ypmatch"
programs should be included with your distribution of traditional
NIS or NYS.
-->
とすれば、
指定したユーザのエントリがパスワードファイルから取り出されて表示されます
(userid には適当なユーザのログイン名を入れます)。
なお <command>ypcat</command> や <command>ypmatch</command> は、
trad-NIS や NYS の配布パッケージに入っています。
</Para>

<Para>
<!--O
If a user cannot log in, run the following program on the client:
-->
ユーザーによるログインができない場合には、
以下のプログラムをクライアントで実行してみて下さい。
</Para>

<ProgramListing>
#include &#60;stdio.h&#62;
#include &#60;pwd.h&#62;
#include &#60;sys/types.h&#62;

int
main(int argc, char *argv[])
{
  struct passwd *pwd;

  if(argc != 2)
    {
      fprintf(stderr,"Usage: getwpnam username\n");
      exit(1);
    }

  pwd=getpwnam(argv[1]);

  if(pwd != NULL)
    {
      printf("name.....: [%s]\n",pwd-&#62;pw_name);
      printf("password.: [%s]\n",pwd-&#62;pw_passwd);
      printf("user id..: [%d]\n", pwd-&#62;pw_uid);
      printf("group id.: [%d]\n",pwd-&#62;pw_gid);
      printf("gecos....: [%s]\n",pwd-&#62;pw_gecos);
      printf("directory: [%s]\n",pwd-&#62;pw_dir);
      printf("shell....: [%s]\n",pwd-&#62;pw_shell);
    }
  else
    fprintf(stderr,"User \"%s\" not found!\n",argv[1]);

  exit(0);
}
</ProgramListing>

<Para>
<!--O
Running this program with the username as parameter will print all the
information the getpwnam function gives back for this user. This should
show you which entry is incorrect. The most common problem is, that the
password field is overwritten with a "*".
-->
このプログラムをユーザ名をパラメータとして実行しますと、
そのユーザに対して getpwnam 関数が返す情報が全て表示されます。
これによって、どのエントリが間違っているかがわかるでしょう。
よくある間違いとしては、パスワードのフィールドが
"*" によって上書きされている、などがあります。
</Para>

<Para>
<!--O
GNU C Library 2.1 (glibc 2.1) comes with a tool called getent. Use this
program instead the above on such a system. You could try:
-->
GNU C Library 2.1 (glibc 2.1) には
<command>getent</command> というツールがついてきます。
そのようなシステムでは、上記の代わりにこちらを使いましょう。

<Screen>
% getent passwd
</Screen>

<!--O
or
-->
や

<Screen>
% getent passwd login
</Screen>

のように試してみましょう。
</Para>

</Sect1>

<Sect1 id="bootup">
<!--O
<Title>Surviving a Reboot</Title>
-->
<Title>再起動時の自動実行</Title>
<!--NAKANO うまい訳希望 :-) -->
<Para>
<!--O
Once you have NIS correctly configured on the server and client, you do need
to be sure that the configuration will survive a reboot.
-->
NIS がサーバやクライアントで正しく設定できたら、
この設定が起動時にも正しく反映されるかを確認しなければなりません。
</Para>
<Para>
<!--O
There are two separate issues to check: the existence of an init script and
the correct storage of the NIS domain name.
-->
チェックする点は 2 つあります。
起動スクリプトがあるかどうかと、
NIS ドメイン名が正しい場所に保存されているかどうか、です。
</Para>
<Sect2>
<!--O
<Title>NIS Init Script</Title>
-->
<Title>NIS 用の起動スクリプト</Title>
<Para>
<!--O
In your version of Linux, you need to check your directory of init scripts,
typically <filename>/etc/init.d</filename>, <filename>/etc/rc.d/init.d
</filename> or <filename>/sbin/init.d</filename> to be sure there is a
startup script there for NIS. Usually this
file is called <filename>ypbind</filename> or <filename>ypclient</filename>.
-->
あなたの使っている Linux での
起動スクリプトの置場所になっているディレクトリを調べましょう。
<simplelist type="inline">
 <member><filename>/etc/init.d</filename></member>
 <member><filename>/etc/rc.d/init.d</filename></member>
 <member><filename>/sbin/init.d</filename></member>
</simplelist>
などになっていると思います。
NIS の起動スクリプトがあるかどうか確認しましょう。
ファイルの名前はふつう
<filename>ypbind</filename> とか
<filename>ypclient</filename> となっているようです。
</Para>
</Sect2>

<Sect2>
<!--O
<Title>NIS Domain Name</Title>
-->
<Title>NIS ドメイン名</Title>
<Para>
<!--O
Perhaps the greatest issue that some people have with NIS is ensuring that
the NIS domain name is available after a reboot. According to Solaris 2.x,
the NIS domain name should be entered as a single line in:
-->
おそらくある種の人々にとって、
NIS を使う上での最大の難関は、
NIS ドメイン名を再起動後にも取得できるようにすることでしょう。
Solaris 2.x では、NIS ドメイン名は

<Screen>
/etc/defaultdomain
</Screen>

<!--O
However, most Linux distributions does not seem to use this file.
-->
に 1 行で書かれていました。
しかし、ほとんどの Linux ディストリビューションでは
このファイルは使っていないようです。
</Para>


</Sect2>
<Sect2>
<!--O
<Title>Distribution-specific Issues</Title>
-->
<Title>ディストリビューション固有の話題</Title>
<Para>
<!--O
At this time, the following information is known about how various Linux
distributions handle the storage of the NIS domainname.
-->
現在のところ、
いろいろな Linux ディストリビューションにおける
NIS ドメイン名の保管場所は、以下のようになっているようです。
</Para>

<Sect3>
<Title>Caldera 2.<emphasis>x</emphasis></Title>
<Para>
<!--O
Caldera uses the file <filename>/etc/nis.conf</filename> which has the same format
as the normal <filename>/etc/yp.conf</filename>.
-->
Caldera は <filename>/etc/nis.conf</filename> 
ファイルを用いているようです。書式は通常の
<filename>/etc/yp.conf</filename> と同じです。
</Para>
</Sect3>

<Sect3>
<Title>Debian</Title>
<Para>
<!--O
Debian appears to follow Sun's usage of <filename>/etc/defaultdomain</filename>.
-->
Debian は Sun と同じく
<filename>/etc/defaultdomain</filename>
を使っているようです。
</Para>
</Sect3>

<Sect3>
<Title>Red Hat 6.<emphasis>x</emphasis>, 7.<emphasis>x</emphasis></Title>
<Para>
<!--O
Create or modify the variable <Command>NISDOMAIN</Command> in the file
<filename>/etc/sysconfig/network</filename>.
-->
<filename>/etc/sysconfig/network</filename> ファイルの
<command>NISDOMAIN</command> 変数を (なければ作成して)
修正してください。
</Para>
</Sect3>

<Sect3>
<Title>SuSE Linux</Title>
<Para>
<!--O
Modify the variable <command>YP_DOMAINNAME</command> in <filename>/etc/rc.config</filename> and then run the command <command>SuSEconfig</command>.
-->
<filename>/etc/rc.config</filename> ファイルの
<command>YP_DOMAINNAME</command> 変数を修正して、
<command>SuSEconfig</command> コマンドを実行してください。
</Para>
</Sect3>

</Sect2>
</Sect1>

<Sect1 id="problems">
<!--O
<Title>Common Problems and Troubleshooting NIS
-->
<Title>NIS でよくおこる問題とその解決方法
<IndexTerm><Primary
>NIS!troubleshooting</Primary></IndexTerm>

<IndexTerm><Primary
>NIS!problems with</Primary></IndexTerm>
</Title>

<Para>
<!--O
Here are some common problems reported by various users:
-->
以下のような問題が多くのユーザから報告されています。
</Para>

<Para>

<OrderedList>
<ListItem>

<Para>
<!--O
The libraries for 4.5.19 are broken. NIS won't work with it.
-->
バージョン 4.5.19 のライブラリは壊れており NIS は動作しません。

</Para>
</ListItem>
<ListItem>

<Para>
<!--O
If you upgrade the libraries from 4.5.19 to 4.5.24 then the
su command breaks. You need to get the su command from the
slackware 1.2.0 distribution. Incidentally that's where you
can get the updated libraries.
-->
ライブラリを 4.5.19 から 4.5.24 にアップグレードすると
<command>su</command> コマンドが使えなくなります。
この場合は <command>su</command> コマンドを Slackware 1.2.0 
から入手します。ついでに最新のライブラリも導入してしまうと良いでしょう。
<!--SHOM 1.2.0 とは、ふ、古い…。最新ではどうなってるんでしょう。-->

</Para>
</ListItem>
<ListItem>

<Para>
<!--O
When a NIS server goes down and comes up again ypbind starts
complaining with messages like:
-->
NIS サーバを再起動させた際、<command>ypbind</command> が

<screen>
    yp_match: clnt_call:
    RPC: Unable to receive; errno = Connection refused
</screen>

<!--O
and logins are refused for those who are registered in the
NIS database. Try to login as root and kill
ypbind and start it up again. An update to ypbind 3.3 or higher
should also help.
-->
のようなメッセージを表示し、
NIS のデータベースに登録されている人がログインできなくなることがあります。
root でログインして <command>ypbind</command> を
kill し、<command>ypbind</command> を起動しなおしてみて下さい。
ypbind 3.3 以降にアップデートしても解決できると思います。

</Para>
</ListItem>
<ListItem>

<Para>
<!--O
After upgrading the libc to a version greater then 5.4.20, the YP tools
will not work any longer. You need yp-tools 1.2 or later for
libc &#62;= 5.4.21 and glibc 2.x. For earlier libc version you need
yp-clients 2.2. yp-tools 2.x should work for all libraries.
-->
libc を 5.4.20 以上の版にアップグレードすると、
YP tools が動作しなくなります。
libc &#62;= 5.4.21 および glibc 2.x には
yp-tools 1.2 が必要です。
それ以前の版の libc には yp-clients 2.2 が必要です。
yp-tools 2.x ならすべてのライブラリで動作します。

</Para>
</ListItem>
<ListItem>

<Para>
<!--O
In libc 5.4.21 - 5.4.35 yp&lowbar;maplist is broken, you need 5.4.36 or later,
or some YP programs like ypwhich will segfault.
-->
libc 5.4.21-5.4.35 の yp_maplist は壊れています。
yp-tools 1.x を用いるには 5.4.36 以降が必要です。
さもないと ypwhich などの
YP プログラムは segfault してしまうはずです。

</Para>
</ListItem>
<ListItem>

<Para>
<!--O
libc 5 with traditional NIS doesn't support shadow passwords over NIS.
You need libc5 + NYS or glibc 2.x.
-->
libc5 と trad-NIS は shadow パスワードの NIS での配布をサポートしていません。
libc5 + NYS または glibc 2.x を用いる必要があります。
</Para>
</ListItem>
<ListItem>

<Para>
ypcat shadow doesn't show the shadow map. This is correct, the name of
the shadow map is shadow.byname, not shadow.
<!--O
ypcat は "shadow" マップを表示しません。これは正しい動作です。
shadow マップの名前は "shadow.byname" ですから。
-->
</Para>
</ListItem>
<ListItem>

<Para>
<!--O
Solaris doesn't use always privileged ports. So don't use password
mangling if you have a Solaris client.
-->
Solaris は必ずしも特権ポートを用いません。従って
Solaris のクライアントがある場合はパスワード mangling を用いては
いけません。
<!--NAKANO password mangling はどう訳すのがいい？-->
</Para>
</ListItem>

</OrderedList>

</Para>

</Sect1>

<Sect1 id="faq">
<!--O
<Title>Frequently Asked Questions
-->
<Title>よくある質問 (FAQ)
<IndexTerm><Primary
>NIS!frequently asked questions</Primary></IndexTerm>
</Title>

<Para>
<!--O
Most of your questions should be answered by now. If there are still
questions unanswered you might want to post a message to
-->
あなたが疑問に思っていたことはここまでに大部分が解決されたことと思いま
すが、まだ疑問点が残っていましたら、

<SimpleList>
<member>comp.os.linux.networking</member>
</SimpleList>

などに質問すると良いと思います。
</Para>

<Para>
訳注：日本語のニュースグループとしては

<SimpleList>
<member>fj.os.linux</member>
<member>japan.comp.linux</member>
</SimpleList>

などが良いでしょう。
</Para>

<Para>
訳者のページ
(<ULink URL="http://surf.ap.seikei.ac.jp/~nakano/linux/NIS-j.html"
>http://surf.ap.seikei.ac.jp/~nakano/linux/NIS-j.html</ULink>)
には、個人的なインストール体験記が書いてあるほか、
この文書で紹介されているソフトウェア入手先のミラーのうち、
国内のものを紹介しています。
</Para>

</Sect1>

</Article>

