Securing NFS

NFS (Network File System) allows servers to share files over a network. But like all network services using NFS involves risks.

If you don’t have shared directories to export, ensure that the NFS service is NOT enabled and running:

# service nfs status
rpc.mountd is stopped
nfsd is stopped
rpc.rquotad is stopped

And then check using chkconfig

# chkconfig –list nfs
nfs 0:off 1:off 2:off 3:off 4:off 5:off 6:off
#

You probably don’t need the portmap service as well which is used by NFS (the portmap daemon registers rpc-based services for services like NFS, NIS, etc.):

# service portmap status
portmap is stopped

Then check status using chkconfig

# chkconfig –list portmap
portmap 0:off 1:off 2:off 3:off 4:off 5:off 6:off
#

NFS should not be enabled if not needed.
If you must use NFS, use TCP wrapper to restrict remote access.
Make sure you export to only those machines that you really need to.
Use fully qualified domain names to diminish spoofing attempts.
Export only directories you need to export.
Export read-only wherever possible.
Use NFS over TCP.

Trackback URI | Comments RSS

Leave a Reply

You must be logged in to post a comment.