安装:sudo apt-get install nfs-kernel-server
配置:
(1)创建一个配置文件夹:mkdir /home/alex/linux/nfs
(2)修改配置文件:sudo vim /etc/exports
/home/alex/linux/nfs *(rw,sync,no_root_squash,no_subtree_check)
(3)授权nfs目录文件:chmod 777 /home/alex.linux/nfs
(4)重启nfs:
sudo /etc/init.d/portmap restart
sudo /etc/init.d/nfs-kernel-server restart
测试:
(1)本机查看nfs共享目录
showmount -e
(2)客户机远程挂在服务器的nfs共享目录
备注:客户机需要安装nfs-common (sudo apt-get install nfs-common)
sudo mount 172.0.0.1:/home/alex/linux/nfs/mnt
参考:
https://blog.csdn.net/zy799894671/article/details/7832973
https://blog.csdn.net/mybelief321/article/details/9988767
https://www.cnblogs.com/baiduboy/p/7536389.html
https://www.jb51.net/article/157932.htm