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.
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityIs 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.
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 Red Hat Enterprise Linux 5", section 2.2.2 ([direct link (PDF)]).
udev
made the device appear. – Nils Dec 30 '12 at 20:56