1. 安装nfs服务器
sudo apt-get install nfs-kernel-server

2. 在用户目录下创建nfs目录
mkdir /home/用户名/nfs

3. 设置/etc/exports配置文件
sudo vi /etc/exports
添加这行配置
/home/用户名/nfs *(rw,sync,no_root_squash)
nfs---常用服务器构建
4. 重启服务器,重新加载配置文件
sudo /etc/init.d/nfs-kernel-server restart

5. 在nfs目录下创建测试文件hello
cd /home/用户名/nfs
touch hello

6. 测试服务器,把服务器共享目录nfs挂在到/mnt节点
sudo mount –t nfs –o nolock –o tcp IP:/home/用户名/nfs /mnt
nfs---常用服务器构建 ^
7. 进入/mnt目录可以看到hello文件,表示构建成功

8. 卸载网络共享目录
sudo umount /mnt

相关文章:

  • 2021-11-13
  • 2021-12-05
  • 2021-08-09
  • 2021-09-06
  • 2021-12-07
  • 2022-12-23
猜你喜欢
  • 2021-05-22
  • 2021-12-10
  • 2021-04-27
  • 2020-02-29
相关资源
相似解决方案