NFS Server and Client on Centos 7

Here is a quick and dirty working example of an NFS Server setup on Centos 7 that allows anonymous connectivity from any host to an exported filesystem and a Client mount from Fedora.  It can be used to assist in troubleshooting problematic NFS mounts.

On Centos Server, Install NFS

Centos server should be able to ping Fedora machine.

yum install nfs-utils

mkdir /var/nfsshare

chmod -R 755 //var/nfsshare

chown nfsnobody:nfsnobody /var/nfsshare

systemctl enable rpcbind
systemctl enable nfs-server
systemctl enable nfs-lock
systemctl enable nfs-idmap
systemctl start rpcbind
systemctl start nfs-server
systemctl start nfs-lock
systemctl start nfs-idmap

vi /etc/exports

/var/nfsshare *(rw,sync,no_root_squash,no_all_squash)

systemctl restart nfs-server

firewall-cmd –permanent –zone=public –add-service=nfs
firewall-cmd –permanent –zone=public –add-service=mountd
firewall-cmd –permanent –zone=public –add-service=rpc-bind
firewall-cmd –reload

On  Fedora Client, Mount NFS Export

fedora machine should be able to ping centos machine.  edit /etc/hosts if you want to use hostnames (and don’t have DNS).

yum install nfs-utils

mkdir -p /mnt/nfs/var/nfsshare

vi /etc/fstab

centos1:/var/nfsshare /mnt/nfs/var/nfsshare nfs defaults 0 0

mount -a

or mount -t nfs centos1:/var/nfsshare /mnt/nfs/var/nfsshare/

Note that all the above steps are necessary to work.  Once this works, modify it one thing at a time and keep retesting the mount until you find what breaks it.

 

Did you like this?
Tip cyberfella with Cryptocurrency

Donate Bitcoin to cyberfella

Scan to Donate Bitcoin to cyberfella
Scan the QR code or copy the address below into your wallet to send some bitcoin:

Donate Bitcoin Cash to cyberfella

Scan to Donate Bitcoin Cash to cyberfella
Scan the QR code or copy the address below into your wallet to send bitcoin:

Donate Ethereum to cyberfella

Scan to Donate Ethereum to cyberfella
Scan the QR code or copy the address below into your wallet to send some Ether:

Donate Litecoin to cyberfella

Scan to Donate Litecoin to cyberfella
Scan the QR code or copy the address below into your wallet to send some Litecoin:

Donate Monero to cyberfella

Scan to Donate Monero to cyberfella
Scan the QR code or copy the address below into your wallet to send some Monero:

Donate ZCash to cyberfella

Scan to Donate ZCash to cyberfella
Scan the QR code or copy the address below into your wallet to send some ZCash:

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.