Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to Disable auto mount of External Harddrives or USB's in RHEL.

For security reasons I have to disable this feature.

And when I need it I will enable it back.

share|improve this question
In nautilus? (The file manager) – warl0ck Dec 30 '12 at 6:48
I think you should manipulate udev's rules. – PersianGulf Dec 30 '12 at 8:09
How about this service autofs stop and chkconfig autofs off – OmiPenguin Dec 30 '12 at 10:15
RHEL5 does not auto mount these (at least not on my installations) - what are you referring to? I need to right-click on a symbol on my desktop to mount any such device - after udev made the device appear. – Nils Dec 30 '12 at 20:56
@Nils Im referring to External Hard drives. Wrong RHEL 5 does automount External hard drive once you mount them atleast mine does. And how do you right click the device which is not mounted as far as I know unmounted devices doesnot appear on Desktop. – OmiPenguin Dec 31 '12 at 6:19

Start with service autofs stop and chkconfig autofs off. You can also disable GNOME's automounting with the following command:

gconftool-2 --direct \ --config-source xml:readwrite:/etc/gconf/gconf.xml.mandatory \ --type bool \ --set /desktop/gnome/volume_manager/automount_drives false

If you also want to disable the automounting of media like CD/DVD drives, you can also add:

gconftool-2 --direct \ --config-source xml:readwrite:/etc/gconf/gconf.xml.mandatory \ --type bool \ --set /desktop/gnome/volume_manager/automount_media false

For further security, you can also add the following line to /etc/modprobe.conf: install usb-storage /bin/true

All of this together should totally disable automounting in RHEL 5/6. This information comes from The NSA's "Guide to the Secure Configuration of RHEL 5", section 2.2.2.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.