Fedora 13
Sponsored Link

NISサーバー構築
2010/05/30
  各サーバー間でユーザーのアカウント情報を共有できるようにNISサーバーを構築します。
[root@dlp ~]#
yum -y install ypserv rpcbind


[root@dlp ~]#
ypdomainname srv.world
 
# NISドメイン指定

[root@dlp ~]#
vi /etc/sysconfig/network


NETWORKING=yes
HOSTNAME=dlp.srv.world
# 最終行へ追記

NISDOMAIN=srv.world


[root@dlp ~]#
vi /var/yp/Makefile


# MERGE_PASSWD=true|false
# 42行目:変更

MERGE_PASSWD=
false


# MERGE_GROUP=true|false
# 46行目:変更

MERGE_GROUP=
false


# 78行目:変更

ALIASES =
/etc/aliases


# 117行目:追記

all: passwd
shadow
 group hosts rpc services netid protocols

[root@dlp ~]#
vi /var/yp/securenets


host
127.0.0.1

255.255.255.0
10.0.0.0


[root@dlp ~]#
/etc/rc.d/init.d/rpcbind start

Starting portmap:
[  OK  ]

[root@dlp ~]#
/etc/rc.d/init.d/ypserv start

Starting YP server services:
[  OK  ]

[root@dlp ~]#
/etc/rc.d/init.d/yppasswdd start

Starting YP passwd service:
[  OK  ]

[root@dlp ~]#
chkconfig rpcbind on

[root@dlp ~]#
chkconfig ypserv on

[root@dlp ~]#
chkconfig yppasswdd on


[root@dlp ~]#
/usr/lib64/yp/ypinit -m
# NISデータベース更新


At this point, we have to construct a list of the hosts which will run NIS
servers. dlp.srv.world 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.srv.world

next host to add:

The current list of NIS servers looks like this:

dlp.srv.world

Is this correct? [y/n: y]
y
# y キーを押してEnter

We need a few minutes to build the databases...
Building /var/yp/srv.world/ypservers...
Running /var/yp/Makefile...
gmake[1]: Entering directory `/var/yp/srv.world'
Updating passwd.byname...
Updating passwd.byuid...
Updating shadow.byname...
Updating group.byname...
Updating group.bygid...
Updating hosts.byname...
Updating hosts.byaddr...
Updating rpc.byname...
Updating rpc.bynumber...
Updating services.byname...
Updating services.byservicename...
Updating netid.byname...
Updating protocols.bynumber...
Updating protocols.byname...
Updating mail.aliases...
gmake[1]: Leaving directory `/var/yp/srv.world'

dlp.srv.world has been set up as a NIS master server.

Now you can run ypinit -s dlp.srv.world on all slave server.

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

[root@dlp ~]#
cd /var/yp

[root@dlp yp]#
関連コンテンツ
 
Tweet