Linux Disable / Remove All NFS Services

by Vivek Gite on August 16, 2009 · 7 comments

NFS was not designed with security in mind, and has a number of weaknesses, both in terms of the protocol itself and because any NFS installation must expose several daemons, running on both servers and clients, to network attack. I use my CentOS based server only to server web pages and nothing else. How do I disable NFS services under RHEL / CentOS / Fedora Linux?

You can easily disable NFS, which is a commonly used for sharing data and files between machines. However, its use opens many potential security holes. If NFS is not needed, improve the security by removing and disabling NFS. Open a command-line terminal (select Applications > Accessories > Terminal), and then type:
# chkconfig nfslock off
# chkconfig rpcgssd off
# chkconfig rpcidmapd off
# chkconfig portmap off
# chkconfig nfs off

Delete nfs-utils and portmap packages using the yum command:
# yum remove portmap nfs-utils

See also:

Featured Articles:

Share this with other sys admins!
Facebook it - Tweet it - Print it -

{ 7 comments… read them below or add one }

1 Thamizhannal P August 16, 2009

I am using NFS in cluster infrastructure(RHCE4) . Do you have any other alternative for NFS ?

Reply

2 Big Dog August 17, 2009

You can use sshfs…

Edited by moderator: Fixed link

Reply

3 pravinkumar chavan February 16, 2011

i am linux debian v 5.0 user having busybox 1.16.1 and want to remove nfs totally .
i am butting from windows hyperterminal/putty.
above commands not working for me.
getting error
#chkconfig nfslock off
/bin/sh: chkconfig: not found

how to remove nfs related setting?

Reply

4 Vivek Gite February 16, 2011

You need to run:

/etc/init.d/portmap stop
/etc/init.d/nfs-kernel-server stop
apt-get --purge remove nfs-kernel-server nfs-common portmap

See this tutorial for more info.

Reply

5 pravinkumar chavan February 17, 2011

Thanks Vivek, for replying.
Actually there is no portmap file or directory under init.d
what i have is
# cd /etc/init.d/
#
# ls
alsa-utils hwclockfirst.sh udev
hwclock.sh module-init-tools udev-mtab

the one who designed the system told me that he allready hv disable the nfs settings. But then i m not getting the reason for problem.

also I dont have /etc/fstab file

Reply

6 Dre Sr April 26, 2011

I’m runnin Windows Server 2003 with NFS service going and i need to kill the NFS service complete but security scans show it still being there how to kill it completely?

Reply

7 Amina February 10, 2012

my hp 4050n ntwroek printer doesn’t work with large images and certain pdf files in linux.. windows 7 it works flawlessly. I was impressed with Ubuntu’s printing , but it isn’t up to windows spec. It’s also a lot slower with my ntwroek printer.

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <blockquote> <pre> <a href="" title="">
What is 2 + 2 ?
Please leave these two fields as-is:
Solve the simple math so we know that you are a human and not a bot.




Previous post:

Next post: