Always need to safety our server PC so anyone cannot access server PC cannot take data or information from server PC Most of the easy way take information is USB storage device. USB storage device mean pen drive, USB portable HDD etc.
Two type of way disable USB storage device
1. Temporary way
2. Permanent way
In this way, we use some command for disable USB storage device.
The command is
=> lsmod | grep usb_storage
we use this command for confirm to add USB storage device in Linux kernel.
=> modprobe -r usb_storage
we use this command for remove USB storage device from Linux kernel.
Did not add USB storage device. so do not showing any information when you run lsmod | grep usb_storage command.
When add USB storage device. So showing information from Linux kernel.
When we saw confirm information to add USB storage device from Linux kernel.
Now we Will safely remove in USB storage device or umount command use for remove USB storage device
After USB storage device remove, Yet we saw USB storage device information from Linux kernel. Because we don’t remove USB storage device from Linux kernel. Now we remove USB storage device from Linux kernel running this command modprobe -r usb_storage
After use this command we edit a file. When file open write only blacklist usb_storage and save the file.
File location is
=> vi /etc/modprobe.d/blacklist.conf
write only blacklist usb_storage and save the file in blacklist.conf file
USB storage device does not add. so it does not showing any information
Disable USB storage device this method, but some problem this method. If the server PC shutdown or restart, USB storage device will then enable. When you open the server PC after shutdown or restart. You just run this command modprobe -r usb_storage in command prompt and again will become disable USB storage device.
If you need enable USB storage device just open blacklist.conf file and remove blacklist usb_storage from blacklist.conf file.
we need to access Linux kernel file for permanently disable USB storage device.
Kernel file location
=> vi /boot/grub/grub.conf
When Linux kernel file open to write nousb specific place then save file using : wq command
when server PC shutdown or restart however USB storage device will not work.You want to enable USB storage device just remove nousb from Linux kernel file and save the file.
NB:I am sorry for my bad English. If you don’t understand any sentence please write in comment box.
——————— Thanks Everyone