Search The Journal

Wednesday, June 7, 2017

Tutorial: Creating an NFS Share on Centos 7


This tutorial will cover setting up a shared file directory on CentOS 7 using NFS. The guide will be sharing the directory with a Windows 10 Client.


1. Install the software
yum install nfs-utils libnfsidmap

2. Set the services to start on startup
systemctl enable nfs-server
systemctl enable rpcbind

3. Reboot the server
reboot

4. Select the directory you want to share or create one.
mkdir /nfsdir

5. Set permissions on the NFS shared directory
chmod 777 /nfsdir 

6. Edit the /etc/exports file with the location of your shared NFS directory.
Make sure the IP address is that of the PC you are sharing the directory with.
/nfsdir 192.168.1.3(rw,sync,no_root_squash,no_all_squash)

7. Export the directory
exportfs -r

8. Configure firewall
firewall-cmd --permanent --zone public --add-service mountd
firewall-cmd --permanent --zone public --add-service rpc-bind
firewall-cmd --permanent --zone public --add-service nfs
firewall-cmd --reload

9. Edit /etc/rc.local and add the following lines
systemctl restart nfs-server
mount -a

10. Add Services for NFS to Windows 10.
Search for Turn Windows features on or off in the start menu. 

11. Expand Services for NFS and check off Administrative Tools and Client for NFS


















12. After the install reboot your computer

13. Mount the linux share to a network drive. Run the command, where 192.168.1.2 is the address of the Linux server. 
mount 192.168.1.2:\nfsdir z:



Enjoy your new Linux file server!




M0nkey out

No comments:

Post a Comment