Debian NFS Server 以及 MacOS Client
Server Side
安装必要依赖:
apt install nfs-kernel-server nfs-common
编辑配置文件: vi /etc/exports
/media/share *(ro,sync,no_root_squash,no_subtree_check,insecure)
| 字段 | |
|---|---|
/media/share | 要共享的目录 |
* | 指定可访问的IP,*表示全部来源特定网段:192.168.123.0/24特定IP:192.168.123.2 |
rw / ro | 读写 |
sync / async | 文件同步写入到内存与硬盘中 / 文件会先暂存于内存中 |
root_squash / no_root_squash | - 当NFS客户端以root用户身份访问时,映射为NFS服务器的nfs nobody用户- 当NFS客户端以root身份访问时,映射为NFS服务器的root用户 |
subtree_check / no_subtree_check | 是否强制检查父目录权限 |
secure / insecure | 是否允许客户端从大于1024的tcp/ip端口连接服务器(Finder出现“找不到服务器“的错误可以设置为insecure |
anonuid 、anongid | 将远程访问的所有用户都映射为匿名用户,并指定该用户为本地用户和用户组 |
每次修改完 exportfs 文件,都需要应用并导出分享:exportfs -ra。

