In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Linux system to disable USB storage of the specific method is, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain in detail for you, people with this need can come to learn, hope you can gain something.
How do I disable USB storage in a Linux system? Sometimes USB storage needs to be disabled in the system in order to protect data security, so how to disable USB storage in Linux systems?
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 saves the file and exits.
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 can no longer find the driver 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 saves the file and exits. 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
The problem of $sudo modprobe usb-storage makes this approach less ideal, but it works well for non-privileged users.
Restart the system after the changes are complete for the changes to take effect.
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
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.