一、介绍
samba:windows与linux之间文件共享
nfs:linux与linux之间文件共享
二、步骤
1、安装nfs服务器
sudo apt install nfs-kernel-server
2、新建共享目录
sudo mkdir /home/test
sudo chmod -R 777 /home/test
3、修改配置文件
在文件后加入/home/test *(rw,sync,no_subtree_check,no_root_squash)
注意:这里面不能有空格
4、重启服务
sudo /etc/init.d/nfs-kernel-server restart
5、挂载
mount -t nfs [服务器IP地址]:[共享目录路径] [本机用于挂载的路径]
mount -t nfs 1xx.1xx.0.2xx:/home/test /home/cc
挂载成功后可以访问/home/cc,即是访问/home/test
注意
要挂载nfs,需要安装nfs客户端,sudo apt-get install nfs-common