.comment-link {margin-left:.6em;} <$BlogRSDURL$>
Personal setting
3/06/2004
 
NISマップの更新は

# make -C /var/yp

で行う。

Updating netid.byname..の後で以下のエラーが。。。

make[1]: *** No rule to make target `/etc/networks', needed by `networks.byaddr'. Stop.
make[1]: Leaving directory `/var/yp/nisdom'
make: *** [target] Error 2
make: Leaving directory `/var/yp'

passwdやgroupのMapはできているから、ま、いいや。。。
後で調べましょう。そうしましょう。

 
RedHat 8.0からNISに入れなくて悪戦苦闘。

結局、
Setup NIS and NFS Clients on Linux
を見て、Firewall設定だったことが判明。

以下、抜粋。

e) The final preparation is to turn off the firewall. (Further investigate is needed to setup firewall to allow NIS instead of turning it off.)
It can be done by running

/usr/sbin/setup

Select firewall configuration, and choose 'No firewall'. Set it to 'high' or 'medium' security will result in the failure of NIS binding. That is, the ypbind will fail to listen to the NIS server. You'll also see the following error message.

YPBINDPROC_DOMAIN: domain not bound

Wei Yeさん、ありがつお。

ちなみに、後で同じトラブルを繰り返したときのために、日本語でのエラーメッセージなどを書いておこう。
ypcat passwd
とやって出る日本語のメッセージは以下の通り。
No such map passwd.byname. Reason: このドメインを扱うサーバーへバインドできません

あと、/etc/init.d/ypbind restartとかやっても
NISドメインサーバを検索中. YPBINDPROC_DOMAIN: ドメインはバインドされていません
.YPBINDPROC?DOMAIN: ドメインはバインドされていません
が繰り返される。

とりあえず直って、良かった良かった。

NFSの設定は、

/etc/fstabに
decian:/home /home nfs rw,hard,intr 0 0
を追加。

以上でRedhatからも一般ユーザーとしてNISを使ってログオンして、/homeをNFSで共有することができるようになりました。

めでたしめでたし。


3/05/2004
 
DNS Resolver設定を忘れてた

/etc/resolv.confに
nameserver 192.168.1.203
を先頭(searchの後)に追加。

 
/etc/hosts.allowへの設定は必要でした (^^;;;;
あとでちゃんと直すとして、今は面倒くさいので、

ALL: 192.168.1.0/255.255.255.0: ALLOW

としちゃってます。

ところで、DHCPでIPアドレス取得していたんですが、なんか定期的にIPアドレスが変わっちゃいます。DHCP的にはMacアドレスが同じであれば、たとえDHCPのLeaseがExpireしても同じアドレスを使えるはずなのですが、おかしいです。良くわからないのですが、このサーバーの使用目的からしてもそもそもDHCPを使うのはよくなかろうということで、静的IPアドレスにしました。

/etc/network/interfaces で
auto eth0
iface eth0 inet dhcp

となっていたところを
iface eth0 inet static
address 192.168.1.204
network 192.168.1.0
netmask 255.255.255.0
broadcast 192.168.255.255
gateway 192.168.1.1
auto eth0
と変更。

その後、
# ifdown eth0; ifup eth0
ぱちぱち。。。

interfacesっていろいろ書けるみたい。詳しくは
man 5 interfaces

3/03/2004
 
DebianでのNFS設定

/etc/exportsに
/home 192.168.1.0/255.255.255.0(rw)
を追加

/etc/hosts.denyおよび/etc/hosts.allowはとりあえず触らない。あとで考える。

/etc/init.d/nfs-common start
/etc/init.d/nfs-kernel-server start

これで良さそう。

rpcinfo -p localhostでnfsとかnlockmgrとかmountdとかが見えるようになる。

mount localhost:/home /mnt/homeとしてみるが、
mount: localhost:/home failed, reason given by server: Permission denied
と言われる (T_T)

えっと、何かが欠けている。なんだっけ?
やっぱり/etc/hosts.allowに登録しないといけないんだっけ?
あとで調べよう。

3/01/2004
 
Debianの設定を行う。

NTPを使って、時刻設定をするためにntpdateを導入。
起動時に設定してくれれば良いので、/etc/rc.bootにntpdateというスクリプトを作成。
中身は以下の通り。

#! /bin/sh
/usr/sbin/ntpdate eric.nc.u-tokyo.ac.jp

NISを設定するのだけど、shadowパスワードを導入してしまっていることを思い出す。Webを見ると、確かにNISとshadowパスワードは相性がよくないらしい。ということで、shadowパスワードを元に戻す。/usr/sbin/pwunconvを実行する。これで/etc/shadowがなくなり、/etc/passwdに統合される。

NISの設定のために、/etc/default/nisを編集する。ここでNISSERVER=falseのため、ypservが起動されない。
NISSERVER=masterに直す。この後、/etc/init.d/nis startでNIS関連のデーモン(以下参照)が起動される。

decian:/etc/init.d# ./nis start
Starting NIS services: ypserv yppasswdd ypxfrd ypbind [binding to YP server .......... backgrounded]

念のため、rpcinfo -u localhost ypservで確認。

decian:/etc/init.d# rpcinfo -u localhost ypserv
program 100004 version 1 ready and waiting
program 100004 version 2 ready and waiting

次にNISデータ作成。/usr/lib/yp/ypinit -mを実行。

decian:/etc/init.d# /usr/lib/yp/ypinit -m

At this point, we have to construct a list of the hosts which will run NIS
servers. decian 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 .
next host to add: decian
next host to add:
The current list of NIS servers looks like this:

decian

Is this correct? [y/n: y] y
We need some minutes to build the databases...
Building /var/yp/decian/ypservers...
Running /var/yp/Makefile...
make[1]: Entering directory `/var/yp/decian'
Updating passwd.byname...
Updating passwd.byuid...
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 netgroup...
Updating netgroup.byhost...
Updating netgroup.byuser...
make[1]: *** No rule to make target `/etc/networks', needed by `networks.byaddr
. Stop.
make[1]: Leaving directory `/var/yp/decian'
make: *** [target] Error 2
Error running Makefile.
Please try it by hand.

decian has been set up as a NIS master server.

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

これで完了。ypcat passwdなどとやって、NISサーバーが動作していることを確認。
あれ? ところで、NISドメイン名は何になっているの? おぉ。ホスト名がそのまま使われていました。
/etc/init.d/nisを見たところ、/etc/defaultdomainに書かれていることが判明。ホスト名が書かれていたんで、NISドメイン名が同じものになっているんですね。/etc/defaultdomainを編集して、完了。"nisdom"にしてみました。

NISマップの更新はmake -C /var/ypで行う。

NISクライアント側は、
/etc/yp.confにNISサーバーを記述
/bin/domainname
を記述。

/sbin/portmapを起動
/var/ypの作成
/usr/sbin/ypbindの起動

確認コマンド
rpcinfo -p localhost
rpcinfo -u localhost ypbind


Powered by Blogger