1 / 6

How to Block USB Storage Device in Linux

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/

Download Presentation

How to Block USB Storage Device in Linux

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. How to Block USB Storage Devices in Linux

  2. 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

  3. List the content of current runtime kernel USB storage # ls /lib/modules/`uname -r`/kernel/drivers/usb/storage/

  4. 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

  5. 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

  6. Thank You Visit for details https://fedingo.com/how-to-block-usb-storage-devices-in-linux/

More Related