NIS クライアントの設定


  1. NIS に参加したい!

    NIS を受ける場合のクライアントの設定方法です。

  2. 設定手順

    NIS サーバにはクライアントの情報が登録されている前提です。

    1. /etc/hosts

      NIS server ホストを /etc/hosts に追加します。
      下では、casper が client で、galley が server です。

      # cat /etc/hosts
      #
      # Internet host table
      #
      127.0.0.1 localhost
      192.168.5.46 casper.personal.or.jp loghost
      192.168.5.66 galley
      #

    2. /usr/sbin/ypinit -c

      /usr/sbin/ypinit -c を実行し、server のホスト名を与えます。

      # ypinit -c

      In order for NIS to operate sucessfully, we have to construct a list of the
      NIS servers. Please continue to add the names for YP servers in order of
      preference, one per line. When you are done with the list, type a <control D>
      or a return on a line by itself.
      next host to add: galley
      next host to add: ^D
      The current list of yp servers looks like this:

      galley

      Is this correct? [y/n: y] y
      #

    3. /etc/nsswitch.conf

      /etc/nsswitch.conf を /etc/nsswitch.nis で上書きします。或いは編集して nis の設定にします。

      # cp /etc/nsswitch.nis /etc/nsswitch.conf
      #

    4. ypbind の始動

      /usr/lib/netsvc/yp/ypstart を実行して ypbind を開始します。
      或いはマシン自体をリブートしても構いません。

      # /usr/lib/netsvc/yp/ypstart
      starting NIS (YP server) services: ypbind done.
      #

  3. すこしだけ確認

    ypwhich, ypcat, ypmatch 等実行してみます。

    # ypwhich
    galley
    # ypcat hosts | grep elvis
    192.168.5.45 elvis
    # ypmatch casper hosts
    192.168.5.46 casper
    #

もどる Last modified: 04/09/01 00:41:02 JST