NFS Serverの設定

Redhat系なら

yum install nfs-utils

Debian系なら

apt-get install nfs-kernel-server

した後で、/etc/exportsを編集。

exportしたいディレクトリ、アクセスを許可するNW(各種オプション)

などと書けばよいらしい。NWに0.0.0.0/0と書いたら怒られてしまった。

# cat /etc/exports

# /etc/exports: the access control list for filesystems which may be exported
#               to NFS clients.  See exports(5).
#
# Example for NFSv2 and NFSv3:
# /srv/homes       hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)
#
# Example for NFSv4:
# /srv/nfs4        gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
# /srv/nfs4/homes  gss/krb5i(rw,sync,no_subtree_check)
#
/srv/nfs        192.168.0.0/16(rw,no_subtree_check,no_root_squash)

/etc/exportsを変更した後は、以下のコマンドで変更を反映させる

# exportfs -ra

これだけで他のマシンからmountできてしまう。
mountの方法は

mount -t nfs : <ローカルのmount先ディレクトリ>

とする。