Fedora 16
Sponsored Link

NISサーバー構築2011/11/11

  各サーバー間でユーザーのアカウント情報を共有できるようにNISサーバーを構築します。
[root@master ~]#
yum -y install ypserv rpcbind
[root@master ~]#
ypdomainname srv.world
 
# NISドメイン指定

[root@master ~]#
vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=dlp.srv.world
# 最終行へ追記

NISDOMAIN=srv.world
[root@master ~]#
vi /var/yp/Makefile
# MERGE_PASSWD=true|false
# 50行目:変更

MERGE_PASSWD=
false
# MERGE_GROUP=true|false
# 54行目:変更

MERGE_GROUP=
false
# 125行目:追記

all: passwd
shadow
 group hosts rpc services netid protocols
[root@master ~]#
vi /var/yp/securenets
255.255.255.0   10.0.0.0

[root@master ~]#
vi /etc/hosts
# NISデータベース登録用に自身のIPを登録

10.0.0.100  master master.srv.world

[root@master ~]#
systemctl start rpcbind.service

[root@master ~]#
systemctl start ypserv.service

[root@master ~]#
systemctl start yppasswdd.service

[root@master ~]#
systemctl enable rpcbind.service

[root@master ~]#
systemctl enable ypserv.service

[root@master ~]#
systemctl enable yppasswdd.service

[root@master ~]#
vi /var/yp/Makefile
# 86行目:変更

ALIASES =
/etc/aliases
[root@master ~]#
/usr/lib64/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: master

next host to add:
# Ctrl + D キーを押す

The current list of NIS servers looks like this:
master
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'
master has been set up as a NIS master server.
Now you can run ypinit -s master on all slave server.
# 以降、新しくユーザーを追加した場合は、以下のようにしてNISデータベースの更新もする

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

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