Thursday, February 2, 2017

How to stop USB Mass Storage device in RHEL/CentOS

Hello Friends,

I’d like to disable all USB devices connected to our Red Hat Linux based workstations. I’d like to disable USB flash or hard drives, which users can use with physical access to a system to quickly copy sensitive data from it.

How do I disable USB device support under RHEL/CentOS workstation operating systems. The USB storage drive automatically detects USB flash or hard drives. You can easily force and disable USB storage devices under any Linux distribution.

The modprobe program used for automatic kernel module loading and can be configured to not load the USB storage driver upon demand. This will prevent the modprobe program from loading the usb-storage module, but will not prevent root (or another program) from using the insmod program to load the module manually.


In linux it’s even more easily done, by unloading the usb_storage module:

for disable the usb storage run the below command :-

# modprobe -r usb_storage

for enable the usb storage run the below command :-

# modprobe -i usb_storage

##############################################################################

The easiest way to disable usb storage device in linux is create following file And add following line inside the file

# touch /etc/modprobe.d/no-usb


install usb-storage /bin/true

##############################################################################

2 comments:

  1. Hi, nice content it's Help me to block usb on my linux machine for testing

    ReplyDelete