在 FreeBSD 上 NIS (YP)/NFS Server/Client 的设定实例
(參考 FreeBSD Handbook)
环境说明:
Subnet - 10.14.16.0/24
Machines -
10.14.16.254 n0
10.14.16.1 n1
10.14.16.2 n2
...
n0 將被設定為 NFS/NIS Server 同時也是 NIS Client
n1, n2, ... 將被設為 NFS/NIS Clients
0. /etc/hosts 的共同部份
10.14.16.254 n0.genome.kmu.edu.tw n0
10.14.16.254 n0.genome.kmu.edu.tw.
10.14.16.1 n1.genome.kmu.edu.tw n1
10.14.16.1 n1.genome.kmu.edu.tw.
10.14.16.2 n2.genome.kmu.edu.tw n2
10.14.16.2 n2.genome.kmu.edu.tw.
10.14.16.3 n3.genome.kmu.edu.tw n3
10.14.16.3 n3.genome.kmu.edu.tw.
1. NFS Server; n0
# vi /etc/rc.conf
portmap_enable="YES"
nfs_server_enable="YES"
# vi /etc/exports
/home/export -maproot=nobody:nogroup -network 10.14.16.0 -mask 255.255.255.0
2. NFS Client: n1
# vi /etc/rc.conf
# vi /etc/fstab
n0:/home/export /home/export nfs rw 0 0
# mount -a
3. NIS Server: n0
# vi /etc/rc.conf
portmap_enable="YES"
nisdomainname="cluster"
nis_server_enable="YES"
nis_yppasswdd_enable="YES"
# cd /var/yp
# cp /etc/master.passwd master.passwd
# vi master.passwd
移除系統相關帳號
# ypinit -m cluster
# vi /var/yp/Makefile
把 NOPUSH = "True" comment 起?