60 likes | 69 Views
Sometimes you may need to block USB storage devices in Linux. Here are the steps to ensure USB driver is not loaded. #Linux #usb <br><br>Visit https://fedingo.com/how-to-block-usb-storage-devices-in-linux/
E N D
Identify the device driver For this purpose, we will use lsmod command. It will list all device drivers loaded in kernel. But its output can be really long so we pass it through grep command and search for ‘usb_storage’ to get the line pertaining to USB devices. # lsmod | grep usb_storage
List the content of current runtime kernel USB storage # ls /lib/modules/`uname -r`/kernel/drivers/usb/storage/
Block USB storage module from loading into kernel RHEL/CentOS/Fedora # cd /lib/modules/`uname -r`/kernel/drivers/usb/storage/ # ls # mv usb-storage.ko.xz usb-storage.ko.xz.blacklist Ubuntu/Debian $ cd /lib/modules/`uname -r`/kernel/drivers/usb/storage/ $ ls $ mv usb-storage.ko usb-storage.ko.blacklist
Unblock USB storage If you want to undo the above changes, just run the following commands. # cd /lib/modules/`uname -r`/kernel/drivers/usb/storage/ # mv usb-storage.ko.xz.blacklist usb-storage.ko.xz
Thank You Visit for details https://fedingo.com/how-to-block-usb-storage-devices-in-linux/