ban usb mass storage device in centos6/7 system

For some environments, there may be restrictions on mass storage devices, how to do it in centos, see the following content may help you, other linux distributions are similar.

Note: The following operations use the root user, and the following operations do not affect other USB devices.

1. usb-storage.ko directory location
The current storage driver under the kernel
/lib/modules/$(uname -r)/kernel/drivers/usb/storage/usb-storage.ko

2. Temporarily prohibit usb large-capacity disks Use (it will fail after restarting, and the USB storage will be available for recovery)
     rmmod usb-storage

3. Permanently disable the usb large-capacity disk (it will still be valid after restarting, and the USB storage will still not be available)
     1. Add in /etc/modprobe.d/blacklist.conf One line:
       blacklist usb-storage 2. Execute        modprobe -r usb-storage
     on the command line 4. You can also manually load it again to take effect. The above two methods can manually restore the     temporary recovery mode:           modprobe usb-storage           insmod usb-storage      permanent Recovery method:          1) Delete in /etc/modprobe.d/blacklist.conf









                     blacklist usb-storage
               2) Manually load
          modprobe usb-storage

          insmod usb-storage

I hope the above text can help you, original article, please indicate the source when reprinting.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326722539&siteId=291194637