Monday, April 25, 2016

Setting up Simple NFS Server


  • Creating a simple NFS accessible to all.
    • vim /etc/exports
    • /share *(rw,all_squash) <--all users will be match to nfsnobody user.
    • mkdir /share
    • chown nfsnobody /share <-- changed user ownership to nfsnobody upon using all_squash
    • systemctl enable nfs-server
    • systemctl start nfs-server
    • exportfs -r         <--export only new configuration.
    • showmount -e localhost
    • firewall-cmd --permanent --add-service=nfs
    • firewall-cmd --reload
  • Mounting shared NFS 
    • mount server2:/share /nfs

[root@server3 ~]# mount |grep nfs
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw,relatime)
nfsd on /proc/fs/nfsd type nfsd (rw,relatime)
server2:/share on /nfs type nfs4 (rw,relatime,vers=4.0,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=192.168.23.133,local_lock=none,addr=192.168.23.132)

No comments:

Post a Comment