1. 安装
$ su
Ubuntu
$ apt install nfs-kernel-server rpcbind nfs-common
Fedora
$ dnf install nfs-utils rpcbind
CentOS
$ yum install nfs-utils rpcbind
OpenSUSE
$ zypper install nfs-kernel-server rpcbind nfs-client
2. 准备一个 Shared Folder
$ cd /home/username
$ mkdir Share
$ chmod 777 Share
3. 设置
$ gedit /etc/exports
/home/username/Share *(rw,sync,no_subtree_check,no_root_squash)
$ exportfs -a
4. 开启
$ systemctl start rpcbind nfs-server
5. 用 NFS 客户端连接以上服务
Linux
$ su
客户端需要安装 nfs-common (Ubuntu), nfs-utils (Fedora / CentOS), nfs-client (OpenSUSE)
$ showmount -e SERVER_IP
$ mkdir -p /home/client/Store
$ mount -t nfs SERVER_IP:/home/username/Share /home/client/Store -o proto=tcp -o nolock
$ ls /home/client/Store
$ umount /home/client/Store
确认连接没问题的话, 可以写入 /etc/fstab ..
$ gedit /etc/fstab
SERVER_IP:/home/username/Share /home/client/Store nfs ro,hard,intr 0 0
Windows
https://sourceforge.net/projects/nfsclient/files/
没有评论:
发表评论