CentOS-7.5-配置NFS服务-文件管理

#环境配置
#虚拟主机服务器:CentOS 7.5
#服务器ip:192.168.122.144


#要求:
#1.配置NFS服务
#2.Linux下自动挂载 NFS 硬盘


#服务器操作
#关闭selinux操作的
setenforce 0
sed -i "s/SELINUX=enforcing/SELINUX=disabled/g"  /etc/selinux/config


安装
yum install nfs-utils rpcbind -y
开机启动
systemctl enable rpcbind
systemctl enable nfs-server
启动
systemctl start rpcbind
systemctl restart nfs-server


#firewall

firewall-cmd --add-service=rpc-bind --permanent
firewall-cmd --add-service=rpc-bind

firewall-cmd --add-port=892/{tcp,udp}
firewall-cmd --add-port=2048/{tcp,udp}
firewall-cmd --add-port=2049/{tcp,udp}
firewall-cmd --remove-port=892/{tcp,udp} --permanent
firewall-cmd --remove-port=2048/{tcp,udp} --permanent
firewall-cmd --remove-port=2049/{tcp,udp} --permanent

systemctl restart nfs-server


vim /etc/exprotfs

/tmp *(ro,sync)
/home/test001 *(ro,sync)

showmount -e

mkdir /root/test01
mkdir /root/test02
mkdir -p /home/test001/asd

ls /root/test01
ls /root/test02
mount -t nfs 192.168.122.144:/tmp /root/test02


mount -t nfs 192.168.122.144:/home/test001 /root/test01

mount -t nfs 192.168.122.144:/home/test002 /root/test03



ls /root/test01
ls /root/test02