#sudo apt-get install nfs-kernel-server
修改配置文件/etc/exports,加入 insecure 选项
/home/float *(insecure,rw,async,no_root_squash)
* :允许所有的网段访问
rw :读写权限
sync:资料同步写入内在和硬盘
no_root_squash:nfs客户端共享目录使用者权限
重启服务:
#sudo /etc/init.d/portmap restart <---重启portmap,
#sudo /etc/init.d/nfs-kernel-server restart <---重启nfs服务
#showmount -e <---显示共享出的目录
现在可以在本机上试一下:
#sudo mount -t nfs localhost:/home/float /mnt
注:localhost为本机linux的IP地址
这样就把共享目录挂到了/mnt目录,取消挂载用:
#sudo umount /mnt