Disable USB Storage Device In RHEL 6

0

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 

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

 Disable USB.3

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

Disable USB.4

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

Disable USB.5

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

Disable USB.6

write only blacklist usb_storage and save the file in blacklist.conf file

Disable USB.7

USB storage device does not add. so it does not showing any information

Disable USB.8

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.

Permanent way

we need to access Linux kernel file for permanently disable USB storage device.

Kernel file location
=> vi /boot/grub/grub.conf 

Disable USB.1

When Linux kernel file open to write nousb specific place then save file using : wq command 

Disable USB.2

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

Share.

About Author

Avatar

Leave A Reply