Skip to content

Instantly share code, notes, and snippets.

@kurtis318
Last active April 25, 2019 18:28
Show Gist options
  • Select an option

  • Save kurtis318/80d35f2a205b9883c963ac00b26f9c23 to your computer and use it in GitHub Desktop.

Select an option

Save kurtis318/80d35f2a205b9883c963ac00b26f9c23 to your computer and use it in GitHub Desktop.
Setup nsf server and client on Centos 7

Web Sites

Configure NFSv3 and NFSv4 on CentOS 7

The following a good explanation of root_squash, no_root_squash and all_squash. All I know is that if root is to be able see data, no_root_squash needs to be specified in the /etc/exports line for the directory. https://computingforgeeks.com/configure-nfsv3-and-nfsv4-on-centos-7/

Beginners Guide to NFS in CentOS/RHEL

The following site is easy to follow but lacks in-depth information about the squashing. https://www.thegeekdiary.com/beginners-guide-to-nfs-in-centos-rhel/

Server Configuration

# yum -y install nfs-utils
# firewall-cmd --add-service=nfs --permanent
# firewall-cmd --reload
# firewall-cmd --list-all

More...

Note that nfs-lock might not be available on Fedora systems.

# cat /etc/exports
/home/kurtis    192.168.0.1/24(rw,async,no_root_squash) 192.168.122.1/24(rw,async,no_root_squash)

# systemctl enable nfs-server
# systemctl restart rpcbind nfs nfs-lock
# systemctl status rpcbind nfs nfslock nfs-server

Even more...

# showmount -e
Export list for ladyred:
/home/kurtis 192.168.122.1/24,192.168.0.1/24

Use the following command to make changes to /etc/exports active:

exportfs -a

Client Configuration

# yum -y install nfs-utils
# mkdir -p /root/mnt/tmp1
# mount -t nfs 192.168.122.1:/home/kurtis /root/mnt/tmp1
# ll /root/mnt/tmp1/
total 16
drwxrwxr-x 2 kurtis kurtis 4096 Feb  4 10:20 bin
drwxrwxr-x 5 kurtis kurtis 4096 Apr 16  2018 dev
drwxrwxr-x 2 kurtis kurtis 4096 Feb 22 11:10 Downloads
drwxrwxr-x 2 kurtis kurtis 4096 Feb 26 09:45 tmp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment