nfs/install-server.sh

raw link view readme
1
2 yum install firewalld -y
3 systemctl start firewalld
4 firewall-cmd --permanent --add-interface=eth0 --zone=public
5 firewall-cmd --permanent --add-service=nfs --zone=public
6 firewall-cmd --reload
7
8 yum install nfs-utils -y
9
10 mkdir /var/nfs
11 echo test file > /var/nfs/file01
12 chown -R nobody:nobody /var/nfs
13 chmod -R 755 /var/nfs
14
15 sed -i.original "s/RPCNFSDARGS.*/RPCNFSDARGS=\"--no-nfs-version 4\"/" /etc/sysconfig/nfs
16
17 systemctl start nfs-server
18 systemctl enable nfs-server
19
20 cat >> /etc/exports << EOF
21 /var/nfs $CLIENTNAME(rw,sync,root_squash)
22 EOF
23
24 exportfs -a
25