don't dream your life, live your dreams !
I assume that you have a Centos installation.
You can copy/paste this script and use it to configure automatically your server.
echo "install nfs tools" dnf -y install nfs-utils echo "start nfs on startup" systemctl enable rpcbind.service systemctl enable nfs.service echo "start service" systemctl start rpcbind.service systemctl start nfs.service echo "add right to anonymous user NFS (id 65534)" mkdir -p /opt/nfs chown 65534:65534 /opt/nfs chmod 755 /opt/nfs echo "add rule to enable connection for client 192.168.0.10 (must set ip address)" cat > /etc/exports << "EOF" /opt/nfs 192.168.0.10(rw,sync) EOF echo "enable rules" exportfs -a echo "add service nfs (ports 111,2049,4045) to firewall" echo "to find port list : rpcinfo -p" firewall-cmd --permanent --add-service nfs echo "reload firewall-cmd" firewall-cmd --reload
echo "install nfs tools" yum -y install nfs-utils nfs-utils-lib echo "start nfs on startup" chkconfig rpcbind on chkconfig nfs on echo "start service" service rpcbind start service nfs start # Add this line to you /etc/fstab: # myserver:/opt/nfs /mnt/nfs nfs rw,sync,hard,intr 0 0 |
That’s all 🙂
Copyright © 2024 My linux world - by Marc RABAHI
Design by Marc RABAHI and encelades.
admin