12 Sep

Auto config NFS services install script for Centos 7

Auto config NFS services install script for Centos 7

What is NFS?
Services for Network File System (NFS) provides a file-sharing solution for enterprises that have a mixed Windows and UNIX environment. Services for NFS enables users to transfer files between computers running the Windows Server operating system and UNIX-based computers using the NFS protocol.

The below script will auto configure NFS in your linux server with “*” wildcard access of “/home/nfs” folder location, will adjust everything you need including your firewall and auto boot for NFS.

before running script make sure you have “wget” installed “yum install wget -y”.

wget github.com/NocRoom/centos7nfs/blob/master/nfs.sh
chmod 777 ./nfs.sh
./nfs.sh

Most common exports options

Here are the most common NFS export techniques and options:

/home/nfs/ 10.1.1.55(rw,sync) export /home/nfs directory for host with an IP address 10.1.1.55 with read, write permissions, and synchronized mode
/home/nfs/ 10.1.1.0/24(ro,sync) export /home/nfs directory for network 10.1.1.0 with netmask 255.255.255.0 with read only permissions and synchronized mode
/home/nfs/ 10.1.1.55(rw,sync) 10.1.1.10(ro,sync) export /home/nfs directory for host with IP 10.1.1.55with read, write permissions, synchronized mode, and also export /home/nfs directory for another host with an IP address 10.1.1.10 with read only permissions and synchronized mode
/home/nfs/ 10.1.1.55(rw,sync,no_root_squash) export /home/nfs directory for host with an IP address 10.1.1.55with read, write permissions, synchronized mode and the remote root user will be treated as a root and will be able to change any file and directory.
/home/nfs/ *(ro,sync) export /home/nfs directory for any host with read only permissions and synchronized mode
/home/nfs/ *.linuxconfig.org(ro,sync) export /home/nfs directory for any host within linuxconfig.org domain with a read only permission and synchronized mode
/home/nfs/ foobar(rw,sync) export /home/nfs directory for hostname foobar with read, write permissions and synchronized mode
NocRoom  | info@e.nocroom.com wNocRoom 
Share this