Sunday, September 5, 2010

HOW TO CONFIGURE NFS SERVER IN RHEL5 (LINUX)

NFS (Network file System)SERVER SIDE CONFIGURATION

The Network File system is one of the most widely used network services.NFS is based on the
Remote procedure call or Portmap Service.It allows the client to mount,automount and therefore,transparently
access the remote file systems on the network.

Portnumber use:-

Port: 2049 {udp,tcp} by nfs
port: 111 {udp,tcp,sunrpc} by portmap

So, NFS daemon should be listening on both standard ports 2049 and portmap on port 111.

You can Check the portnumber of any protocol or service using following command:-

#cat /etc/services | grep 111 (here 111 is portnumber of portmap service)

#cat/etc/services | grep 2049 (here 2049 is portnumber of nfs)


We can also check the functioning of NFS by rpcinfo command.

#rpcinfo -p

after this we need to define all export folder or directories (all directories u want to share)
in /etc/exports file.


#vim /etc/exports

/home/directoryname 10.0.0.1(rw,sync,no_root_squash)
/home/dir1 10.0.0.0/24(ro,sync)


sync=synchronized mode
no_root_squash= by using this the remote client root user will be treated as a root and will
be able to change any file and directory and work as a root for that directory



Then after this restart the nfs service :-


# /etc/init.d/nfs restart or service nfs restart



If you later add some more exports in the /etc/exports file you can restart the nfs service
or run the exportfs command:

#exportfs -ra

No comments:

Post a Comment