linux下nfs共享目录

 1 1. 关掉防火墙
 2     systemctl disable firewalld.service
 3 
 4 
 5 2. 关掉selinux
 6     vim /etc/selinux/config
 7     修改第七行:
 8     7 SELINUX=disabled
 9 
10     保存退出后,重启pc
11 
12 
13 3. 安装nfs
14     yum install nfs*
15 
16 4. 配置nfs
17     增加要共享的目录路径,如要共享/_install
18     vim /etc/exports
19     /_install    *(rw,sync,insecure,no_root_squash)
20        
21     保存退出后,执行生效命令:
22     systemctl start nfs.service
23     每次开机都需要执行这个命令,也可以把这个命令加入/etc/rc.local里自动执行
24 
25  /* insecure 表示允许跨网段来访问 */
26  /* no_root_squash 表示使用root权限 */

猜你喜欢

转载自www.cnblogs.com/edan/p/9132899.html