Monday, December 13, 2010

NFS configure

參考網址:Debian WiKitldp

系統:Debian5.0
Kernel:2.6.32-5-686
套件:(v)nfs-server:nfs-kernel-server,nfs-common、nfswatch
相依性:libblkid1 (>= 2.16), libc6 (>= 2.3), libcomerr2 (>= 1.01), libgssapi-krb5-2 (>= 1.6.dfsg.2), libgssglue1, libk5crypto3 (>= 1.6.dfsg.2), libkrb5-3 (>= 1.6.dfsg.2), libnfsidmap2, librpcsecgss3, libwrap0 (>= 7.6-4~), nfs-common (= 1:1.2.2-4), ucf, lsb-base (>= 1.3-9ubuntu3)

Server設定:
(1) mount和file 的存取權限(/etc/exports、/etc/hosts.allow、/etc/hosts.deny)。
(2) 如果Server放在PORT Base的防火牆內,mountd參數RPCMOUNTDOPTS(/etc/default/nfs-kernel-server)要設固定port("--port xxxx" xxxx>1024,1024之前是系統使用,不建議用1024之前的port)。
(3) quota(/etc/default/quota)、statd(/etc/default/nfs-common)、lockd(Create new file like /etc/modprobe.d/nfs.local.conf)設定檔也可加上固定的port。

Client設定:
(1) mount -t nfs IP:/path/to/share /mountpoint

步驟:

(1) Server
(a) /etc/exports
/shareDIR Client(restriction_1, restriction_2, ...)
(I) rw
(II) root_squash/no_root_squash
(III)...
(b) /etc/hosts.deny
portmap:ALL
(c) /etc/hosts.allow
portmap: allowIP_1/netmask allowIP_2/netmask

(2)restart service
(a) /etc/init.d/portmap restart
(b) /etc/init.d/nfs-kernel-server restart
(c) /etc/init.d/nfs-common restart



**************************沒空~~~~後補啦...=.=+***************************

No comments: