[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debian-devel:01984] nis.debian.howto-ja



鍋谷です。

勢いで nis パッケージ付属の nis.debian.howto を翻訳しました。
少し長いですが以下に添付します。

# 最近は、時間を見てネットワーク回りのドキュメントをコツコツ読んで
# ます。そのついでといった感じです。

大阪大学理学研究科物理学専攻 博士前期課程2年 大坪研究室(06-850-5346)
         鍋谷 栄展      nabetani@xxxxxxxxxxxxxxxxxxxxxxxxxxx
> # $Id: nis.debian.howto,v 2.0 miquels Exp $
> 
> This HOWTO describes:
> 
>   a)  How to setup a NIS client-only system
>   b)  How to specify what resources to use for NIS
>   c)  How to setup a NIS master server
>   d)  How to setup a NIS slave server

この HOWTO では、以下の事項について記述しています。

  a)  NIS クライアントのみのシステムのの設定方法
  b)  NIS が使用するリソースの設定方法
  c)  NIS マスターサーバーの設定方法
  d)  NIS スレーブサーバーの設定方法

> a)  How to setup a local NIS client:
>     --------------------------------
> 
>   1. install the nis, netbase and netstd packages
> 
>   2. set your NIS domain in the /etc/defaultdomain file. The NIS domain
>      is just a name which describes the group of systems that use NIS, it
>      is not a hostname.

a)  NIS クライアントのみのシステムの設定方法
    ----------------------------------------

  1. nis, netbase, netstd パッケージをインストールして下さい。

  2. /etc/defaultdomain ファイル中に自分の NIS ドメインを設定します。 
     NIS ドメインとは、NIS を使用するシステムグループを記述するための名前
     であり、ホスト名ではありません。
 
>   3. If your NIS server is not "local" to your network, read the manpage
>      of "ypbind" and create a /etc/yp.conf file.
> 
>   4. Start NIS by typing:
> 
>        /etc/init.d/nis stop
>        /etc/init.d/nis start
     
  3. あなたの NIS サーバーが自分のネットワークにとって "ローカル" でないの
     でしたら、"ypbind" の man ページを読んで、/etc/yp.conf ファイルを作成
     して下さい。

  4. 以下のようにタイプして NIS を起動させます。

       /etc/init.d/nis stop
       /etc/init.d/nis start

> b) How to specify what resources to use for NIS:
>     ---------------------------------------------
> 
>   1. PASSWORDS: Add the following line to /etc/passwd on your NIS
>      clients:
> 
>     +::::::
> 
>     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.
> 
>     For example, to only allow login-access to miquels,dth and ed , but to have
>     the account data of all other users available:
> 
>     +miquels:::::::
>     +ed:::::::
>     +dth:::::::
>     +:*::::::/etc/NoShell

b) NIS が使用するリソースの設定方法
   --------------------------------

  1. PASSWORDS: /etc/passwd on 自分の NIS クライアントの /etc/passwd に次
     のようなラインを加えて下さい。:

    +::::::

     [訳者注: shadow password を使用する場合、第 3,4 フィールドを空にして
     はいけないようです。]

    + と - 文字を使って、ユーザーを受け入れる/受け入れない、又はユーザーの
    変更を行うことができます。ユーザー guest を入れさせたくないのでしたら、
    あなたの /etc/passwd に -guest を追加するだけです。ユーザー "linux" に
    は違うシェル(例えば ksh)を使わせたいのですか? 簡単です。単に、あなた
    の /etc/passwd に "+linux::::::/bin/ksh" を加えるだけです(引用符は入れ
    ないでください)。あなたが変更したくないフィールドは、空のまま残してお
    く必要があります。

    例えば、ユーザー名 miquels, dth, ed にのみログインを許し、それ以外の全
    てのユーザーはアカウント情報のみを利用できるようにするためには以下のよ
    うにします。

    +miquels:::::::
    +ed:::::::
    +dth:::::::
    +:*::::::/etc/NoShell

>     Note that in Linux you can also override the password field, as we did
>     in this example.
> 
>   2. GROUPS: Add the following line to /etc/group
> 
>     +:::
> 
>   3. HOSTS: If you want to use the NIS host maps of your NIS server you
>      have to change your /etc/host.conf file. You just have to add the
>      word "nis" to the "order" line. A sample host.conf file could look
>      like this:
> 
>      order host,bind,nis
>      multi on
> 
>      Normally you should leave the host.conf file alone.

    この例にあるように、 Linux ではパスワードフィールドを無効にすることも
    できることに注意して下さい。

  2. GROUPS: /etc/group に次のような行を加えて下さい。

    +:::

     [訳者注: shadow password を使用する場合、第3フィールドを空にしてはい
     けないらしいです。]

  3. HOSTS: 自分の NIS サーバーの NIS ホストマップを使用したければ、 自分の
     /etc/host.conf ファイルを変更しなければなりません。これには、"order" 
     の行に "nis" を加えるだけでよい。host.conf ファイルの例は、次のように
     なります。:

     order host,bind,nis
     multi on

     通常は、host.conf ファイルのみを残しておくべきです。

> c) How to setup a master NIS server:
>    ---------------------------------
> 
>   1. install the nis package. You'll also need the netbase and netstd
>      packages installed for the RPC daemons (rpc.portmap).
> 
>   2. Make sure that _all_ systems you are going to use as a NIS server,
>      master or slave, have all other systems in the /etc/hosts file.
>      The FQDN (Fully Qualified Domain Name) should be the first hostname
>      after every IP address, followed by just the hostname (without the
>      domainname). For example:
> 
>         192.168.88.10	troi.cistron.nl	troi
> 
>      On the NIS server the NIS hosts file (which is usually just /etc/hosts)
>      should also have this setup. This is because NIS does not use DNS.

c) NIS マスターサーバーの設定方法:
   ---------------------------------

  1. nis パッケージをインストールして下さい。RPC daemons (rpc.portmap) に
     対しては、netbase と netstd パッケージもインストールされている必要が
     あるでしょう。

  2. NIS サーバーとして使用しようとしている *すべての* システム(つまり、マ
     スター、又はスレーブ)が /etc/hosts ファイルに他の全てのシステム名を保
     持していることを確認して下さい。それぞれの IP アドレスの後には、まず 
     FQDN (Fully Qualified Domain Name) が書かれているべきであり、その後に
     (ドメインネームを除いた)ホスト名を書いておくべきです。例えば次のよう
     になります。

        192.168.88.10	troi.cistron.nl	troi

     NIS サーバー上で、NIS ホストファイル(通常は、/etc/hosts)は、この設定
     も保持しているべきです。これは、NIS が DNS を使用しないからです。

>   3. set your NIS domain in the /etc/defaultdomain file. The NIS domain
>      is just a name which describes the group of systems that use NIS, it
>      is not a hostname. It is common practice to use your DNS domainname
>      for this. This is not a security risk, as many people claim.
> 
>   4. set ypserv to master (ypserv=master) in /etc/init.d/nis
> 
>   5. Add your local network number to the file /etc/ypserv.securenets.
>      You don't _have_ to do this: the default is to allow everybody to
>      access your NIS server. It is however *strongly* recommended.
>      For added security you might also want to edit the /etc/ypserv.conf
>      file to mangle the password file for some clients (do not do this
>      if you have non-debian slave servers in your network!)

  3. /etc/defaultdomain ファイル中に自分の NIS ドメイン名を記述します。
     NIS ドメインとは、単に NIS を使用するシステムグループを記述するため
     の名前であり、ホスト名ではありません。NIS ドメインに自分の DNS 
     domainname を使うことが一般的な慣例となっています。これには、多くの
     人が主張するようなセキュリティー上の危険はありません。

  4. /etc/init.d/nis の中で ypserv を master にして下さい。(ypserv=master)

  5. ファイル /etc/ypserv.securenets に自分のローカルネットワークナンバー
     を加えて下さい。デフォルトでは、誰もがあなたの NIS サーバーにアクセス
     するのを許されてしまいますが、このようにしてはいけません。しかし、これ
     は *強く* 推奨されます。セキュリティを強化するために、/etc/ypserv.conf 
     を編集して、あるクライアントからはパスワードファイルを見えなくしたいか
     も知れません。(あなたのネットワークに Debian 以外のスレーブサーバーが
     あるならこれを行ってはいけません!)

>   6. Setup the server by typing "/usr/lib/yp/ypinit -m"
> 
>   7. Start the server by typing:
> 
>      /etc/init.d/nis stop
>      /etc/init.d/nis start
> 
>     This will start the server (ypserv) and the password daemon (yppasswdd).
>     
>     If you want to restrict access 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 _halfway_ 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. example:

  6. "/usr/lib/yp/ypinit -m" とタイプしてサーバーの設定を行います。

  7. 以下のようにタイプしてサーバーを起動させます。

     /etc/init.d/nis stop
     /etc/init.d/nis start

    これで、サーバー(ypserv) とパスワードデーモン(yppasswdd) が起動します。
    
    自分の NIS サーバーへのアクセスを制限したいならば、NIS サーバーも同様
    にクライアントとしての設定を行う必要があります。このためには、ypbind
    を起動して、パスワードファイル /etc/passwd の途中で + エントリを追加
    します。ライブラリ関数は、はじめの NIS エントリ以後の全ての通常エント
    リを無視し、NIS によって残りの情報を取得します。このようにして NIS ア
    クセスルールが保守されます。例えば、

>     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
> 
>    The user tester will exist, but have a shell of /etc/NoShell. miquels
>    will have normal access.
> 
>    Alternatively, you could edit the /var/yp/Makefile file and set NIS to use
>    another source password file. On big systems, the NIS password and group
>    files are usually stored in /var/yp/ypfiles/. If you do this the normal tools
>    to administrate the password file such as "passwd", "chfn", "adduser" will
>    not work anymore and you will need special homemade tools for this.
> 
>    Remember that after every change in one of the NIS source files, you'll
>    have to run "make" in the /var/yp directory to update the NIS maps. It
>    would be reasonable to do this nightly from cron to be sure the NIS maps
>    are kept up-to-date.

   ユーザー tester が存在するが、シェル /etc/NoShell を持つ。
   ユーザー miquels は、通常のアクセスができる。

   上記とは別に、/var/yp/Makefile ファイルを編集して NIS が別のソースパス
   ワードファイルを使用するようにすることもできます。大きなシステム上では、
   NIS パスワードファイルとグループファイルは通常 /var/yp/ypfiles/ に保存
   されます。しかし、このようにすると、"passwd", "chfn", "adduser" のよう
   なパスワードファイルを管理するための通常のツールが動作しなくなってしま
   います。このための特別な手作りのツールが必要となるでしょう。 
   
   ある NIS ソースファイル中の変更の後、NIS マップを更新するために /var/yp
   ディレクトリで "make" を実行する必要があることを忘れてはいけません。NIS 
   マップを必ず最新にしておくために、毎晩 cron で実行するとよいかもしれま
   せん。

> d) How to setup a NIS slave server
>    _______________________________
> 
>   1. Follow the steps 1-5 as described in c) above, but at step 4. set ypserv
>      to slave (ypserv=slave) in the /etc/init.d/nis file.
> 
>   2. Start the slave and initialize it by entering:
> 
>      /etc/init.d/nis stop
>      /etc/init.d/nis start
>      /usr/lib/yp/ypinit -s <name_of_your_master_nis_server_here>

d) NIS スレーブサーバーの設定方法
   _______________________________

  1. 上記の c) で説明したようにして、ステップ 4 以外のステップ 1-5 に従っ
     て設定していきます。/etc/init.d/nis ファイル中で ypserv を slave に
     して下さい。(ypserv=slave)

  2. 以下のように入力して、スレーブサーバーを起動・初期化します。

     /etc/init.d/nis stop
     /etc/init.d/nis start
     /usr/lib/yp/ypinit -s (マスター NIS サーバー名)

>   3. Now tell your master NIS server it has a slave. First you have to adjust
>      the NIS Makefile *on the master* so that all future updates get
>      distributed to the slave(s) automatically. Unset the NOPUSH variable
>      in /var/yp/Makefile like this:
> 
>        NOPUSH=""
> 
>      Now tell the master about its slaves by running "/usr/lib/yp/ypinit -m".
>      Enter the names of the slave servers. The maps will get rebuilt and
>      pushed to the slaves.

  3. スレーブサーバーがある場合のあなたのマスター NIS サーバーについてです。
     まず、この先すべての更新が自動的にスレーブサーバーに伝播するように
     *マスター上の* NIS Makefile を調整しなければなりません。
     /var/yp/Makefile の中で NOPUSH 変数を設定してはいけません。これは、
     以下のようにします。

     NOPUSH=""

     "/usr/lib/yp/ypinit -m" を実行することで、マスターにスレーブの情報を伝
     えます。スレーブサーバー名を入力して下さい。そのマップが再構築されス
     レーブに転送(プッシュ)されます。
 
>   4. You might want to edit root's crontab *on the slave* and add the following
>      lines:
> 
>       20 *    * * *    /usr/lib/yp/ypxfr_1perhour
>       40 6    * * *    /usr/lib/yp/ypxfr_1perday
>       55 6,18 * * *    /usr/lib/yp/ypxfr_2perday
> 
>      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.

  4. *スレーブマシンの* ルート用 crontab を編集して次の行を加えて下さい。

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

     これによって、マスター上で更新がなされた時にスレーブが停止していたため
     に、スレーブの更新に失敗した場合でさえ、ほとんどの NIS マップが最新情
     報に保たれていることを保証します。