In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the relevant knowledge of how to disable USB storage in Linux, the content is detailed and easy to understand, the operation is simple and fast, and has a certain reference value. I believe you will gain something after reading this article on how to disable USB storage in Linux. Let's take a look.
Method 1 pseudo installation
In this method, we add a line of install usb-storage / bin/true to the configuration file, which makes the operation of installing the usb-storage module actually run / bin/true, which is why this method is called pseudo-installation. Specifically, create and open a file named block_usb.conf (possibly by another name) in the folder / etc/modprobe.d
$sudo vim / etc/modprobe.d/block_usb.conf
Then add the following line:
Install usb-storage / bin/true
Finally save the file and exit.
Method 2 remove the USB driver
This method requires us to delete or remove the driver (usb_storage.ko) stored in USB, so that the USB storage device can no longer be accessed. Execute the following command to remove the driver from its default location:
$sudo mv / lib/modules/$ (uname-r) / kernel/drivers/usb/storage/usb-storage.ko / home/user1
The driver can no longer be found in the default location, so when the USB memory is connected to the system, it cannot be loaded into the driver, causing the disk to become unavailable. But there is a small problem with this approach, which is that when the system kernel is updated, the usb-storage module will reappear in its default location.
Method 3 blacklist USB memory
We can also blacklist usb-storage through the / etc/modprobe.d/blacklist.conf file. This file is readily available on RHEL/CentOS 6, but you may need to create it yourself on 7. To blacklist USB storage, open / create the above file using vim:
$sudo vim / etc/modprobe.d/blacklist.conf
And enter the following line to blacklist USB:
Blacklist usb-storage
Save the file and exit. Usb-storage will be blocked from loading by the system right away, but this method has a big disadvantage that any privileged user can load the usb-storage module by executing the following command
$sudo modprobe usb-storage
This problem makes this approach less ideal, but it works well for non-privileged users.
This is the end of the article on "how to disable USB Storage in Linux". Thank you for reading! I believe that everyone has a certain understanding of the knowledge of "how to disable USB storage in Linux". If you want to learn more, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.