Debian 6.0
Sponsored Link

NISサーバー構築2011/03/08

  各サーバー間でユーザーのアカウント情報を共有できるようにNISサーバーを構築します。

[1] NISシステムをインストールします。
root@dlp:~#
aptitude -y install nis portmap


Preconfiguring packages ...

# インストール中、NISドメインの設定画面が出るのでドメイン名を入力

# インストール後、自動的に起動を試みるが失敗するので、終わるまで待つか放っておいて別ウィンドウで設定開始する


[2] NISサーバーとしての設定をします。
root@dlp:~#
vi /etc/default/nis


# 6行目:変更(NISマスターサーバーとする)

NISSERVER=
master


root@dlp:~#
vi /etc/ypserv.securenets


# This line gives access to everybody. PLEASE ADJUST!
# コメントにする

#
0.0.0.0 0.0.0.0

# 最終行:アクセス許可する範囲追記

255.255.255.0     10.0.0.0


root@dlp:~#
vi /var/yp/Makefile


# 119行目:追記

ALL = passwd
shadow
group hosts rpc services netid protocols netgrp

root@dlp:~#
vi /etc/hosts


127.0.0.1     localhost
127.0.1.1     dlp.srv.world   dlp
# NISデータベース登録用に自身のIPを登録

10.0.0.30     dlp.srv.world   dlp


root@dlp:~#
/usr/lib/yp/ypinit -m
   
# NISデータベース更新


At this point, we have to construct a list of the hosts which will run NIS
servers. master is in the list of NIS server hosts. Please continue to add
the names for the other hosts, one per line. When you are done with the
list, type a <control D>
.     next host to add: dlp
    next host to add:    
# Ctrl+D を押す

The current list of NIS servers looks like this:

dlp

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

We need a few minutes to build the databases...
Building /var/yp/srv.world/ypservers...
gethostbyname(): Success
Running /var/yp/Makefile...
make[1]: Entering directory `/var/yp/srv.world'
Updating passwd.byname...
failed to send 'clear' to local ypserv: RPC: Program not registeredUpdating passwd.byuid...
failed to send 'clear' to local ypserv: RPC: Program not registeredUpdating group.byname...
failed to send 'clear' to local ypserv: RPC: Program not registeredUpdating group.bygid...
failed to send 'clear' to local ypserv: RPC: Program not registeredUpdating shadow.byname...
failed to send 'clear' to local ypserv: RPC: Program not registeredUpdating hosts.byname...
failed to send 'clear' to local ypserv: RPC: Program not registeredUpdating hosts.byaddr...
failed to send 'clear' to local ypserv: RPC: Program not registeredUpdating rpc.byname...
failed to send 'clear' to local ypserv: RPC: Program not registeredUpdating rpc.bynumber...
failed to send 'clear' to local ypserv: RPC: Program not registeredUpdating services.byname...
failed to send 'clear' to local ypserv: RPC: Program not registeredUpdating services.byservicename...
failed to send 'clear' to local ypserv: RPC: Program not registeredUpdating netid.byname...
failed to send 'clear' to local ypserv: RPC: Program not registeredUpdating protocols.bynumber...
failed to send 'clear' to local ypserv: RPC: Program not registeredUpdating protocols.byname...
failed to send 'clear' to local ypserv: RPC: Program not registeredUpdating netgroup...
failed to send 'clear' to local ypserv: RPC: Program not registeredUpdating netgroup.byhost...
failed to send 'clear' to local ypserv: RPC: Program not registeredUpdating netgroup.byuser...
failed to send 'clear' to local ypserv: RPC: Program not registeredmake[1]: Leaving directory `/var/yp/srv.world'

master has been set up as a NIS master server.

Now you can run ypinit -s master on all slave server.

root@dlp:~#
/etc/init.d/nis start

Starting NIS services: ypserv yppasswdd ypxfrd ypbind.

# 以降、新しくユーザーを追加した場合は、以下のようにしてNISデータベースの更新もする

root@dlp:~#
cd /var/yp

root@dlp:/var/yp#
関連コンテンツ