Install the NFS packages:
# yum groupinstall -y "NFS file server"
Add new rules to the firewall:
# iptables -I INPUT -m state --state NEW -m udp -p udp --dport 111 -j ACCEPT # iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport 111 -j ACCEPT # iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport 2049 -j ACCEPT
Save the firewall configuration:
# service iptables save
Activate the nfs services at boot:
# chkconfig rpcbind on # chkconfig nfs on # chkconfig nfslock on
Start the nfs services:
# service rpcbind start # service nfs start # service nfslock start
Create a directory to export:
# mkdir /shared
Create a dedicated group:
# groupadd -g 60000 sharedgrp
Assign this group to the new directory:
# chgrp sharedgrp /shared
Define permissions:
# chmod 2770 /shared
Edit the /etc/exports file and add the following lines with the name (or IP address) of the client(s):
/shared client(rw,no_root_squash)
Export the directories:
# exportfs -avr
Note: the client needs to have access to the same group (via LDAP) and be a member of this group.
Leave a Reply
You must be logged in to post a comment.