Info: NFS Server&Client Setup

Posted on Updated on

Server Side

NFS share with read/write privilege for the specified UID and GID, So even root will denied to write or read in that particular mount point and completly secure from everything.

Install required packages of  NFS server.

apt-get install nfs-kernel-server nfs-common portmap

After the installation of NFS server edit /etc/exports fileand add a line as follows.

     ↓           ↓                            ↓
NFSsharepath | network | Options(Here we need to set user id and group id of tomcat user)

Restart nfs server after making necessary changes in  the exports file.

#service nfs-kernel restart

Client side Linux

Install nfs client packages on NFS client machine. Mount nfs share in the client machine.

apt-get install portmap nfs-common

Make the following entry in /etc/fstab/ /home/nfs   nfs rsize=8192,wsize=8192,timeo=14,intr
           ↓                        ↓         ↓
Network share details          Mount point   Filesystem

Client Side Windows

Install nfs services for windows through control panel add or remove windows component wizard.

Edit Windows registery and make changes as follows  in the registery.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ClientForNFS \CurrentVersion\Default

1, Create two DWORD values namely AnonymousUid and AnonymousGid
2, Set these values to the UID and GID as set in the  NFS server for tomcat user (Eg:-106,114)
3, Restart NFS service.

Go to all programs- Administrative tools- Services for network filesystem and Start service of ClientForNFS.
Select properties of clientfornfs and set permissions as per the requirement. (Eg:- Read&write permission for the