天天看点

Ubuntu配置NFS服务器(Linux挂载Linux)

Ubuntu配置NFS服务器

服务器端的配置

  • Ubuntu安装NFS服务器端
sudo apt-get install nfs-kernel-server
           
Ubuntu配置NFS服务器(Linux挂载Linux)
  • 服务端查看版本
Ubuntu配置NFS服务器(Linux挂载Linux)
  • 在桌面上创建共享目录
mkdir share
           
Ubuntu配置NFS服务器(Linux挂载Linux)
  • 修改/etc/export配置文件,在后面添加如下语句
/home/xxx/桌面/share *(rw,sync,no_root_squash)
注意*(rw,sync,no_root_squash)前的空格
xxx:实际用户名
*:允许所有的网段访问,也可以使用具体的IP
rw:挂接此目录的客户端对该共享目录具有读写权限
sync:资料同步写入内存和硬盘
no_root_squash:root用户具有对根目录的完全管理访问权限。
no_subtree_check:不检查父目录的权限
           
Ubuntu配置NFS服务器(Linux挂载Linux)
  • 重启NFS服务
/etc/init.d/nfs-kernel-server restart
           
Ubuntu配置NFS服务器(Linux挂载Linux)

客户端的配置

  • Ubuntu安装NFS客户端
sudo apt-get install nfs-common
           
Ubuntu配置NFS服务器(Linux挂载Linux)
  • 客户端查看版本
  • 客户端挂载服务器的共享目录
sudo mount -t nfs 192.168.198.130:/home/hkl/桌面/share /home/redamancy/桌面/temp
#使用nfs的方式,把Ubuntu服务器 192.168.198.130:/home/hkl/桌面/share文件,挂载到Ubuntu nfs客户端
           
Ubuntu配置NFS服务器(Linux挂载Linux)

在服务器中创建一个server.txt文件,然后再客户端查看

Ubuntu配置NFS服务器(Linux挂载Linux)

继续阅读