Linux Disable USB Devices (Disable loading of USB Storage Driver)

https://w‮l.ww‬autturi.com
Linux Disable USB Devices (Disable loading of USB Storage Driver)

There are several ways to disable USB devices or prevent the loading of the USB storage driver in Linux:

  1. Use the "blacklist" option in the kernel command line: You can add the "usb-storage.blacklist=yes" option to the kernel command line to prevent the USB storage driver from loading. To do this, follow the same steps as described above for disabling hyperthreading, but add the "usb-storage.blacklist=yes" option instead of "noht".

  2. Edit the modprobe configuration file: You can prevent the USB storage driver from loading by adding a "blacklist" entry to the /etc/modprobe.d/blacklist.conf file. For example:

blacklist usb-storage
  1. Use udev rules: You can use udev rules to prevent specific USB devices from being recognized by the system. To do this, create a file in the /etc/udev/rules.d directory with a name ending in ".rules". In the file, add a rule to specify the device you want to disable, using the appropriate attributes for the device. For example:
SUBSYSTEM=="usb", ATTRS{idVendor}=="0951", ATTRS{idProduct}=="1642", ACTION=="add", ENV{ID_BUS}=="usb", ENV{UDISKS_IGNORE}="1"

This will prevent any USB device with the vendor ID "0951" and product ID "1642" from being recognized by the system.

Note: Disabling USB devices or the USB storage driver may prevent you from using certain features or peripherals on your system. You should consider the impact on your workload before making these changes.

Created Time:2017-10-29 22:08:53  Author:lautturi