How to disable usb storage in ubuntu 16.04 | 18.04 | 20.04

USB storage is blocking is most import thing in office environment to protect company and client critical data, To disable workstation usb storage is the good solution, To disable USB storage in ubuntu, We need to follow the steps one by one.   

In this post, We will know how to disable the USB storage in Ubuntu machine.

Step 1 : Create Blacklist Config File

First need to create a file by following the commands.

sudo nano /etc/modprobe.d/blacklist.conf

In the end of the config file we need to add the following code.

blacklist usb_storage
blacklist uas

Save and exit from the nano editor.

Step 2: Create rc.local file

Also need to open the /etc/rc.local config file using following commands.

sudo nano /etc/rc.local

Add the given lines as below:-

modprobe -r uas

Step 3: Disable USB Storage

USB storage configuration is done, to deactivate usb store run given command, now remove your pen drive and run given command.

sudo rmmod usb_storage

Now your pen drive will not work.

Step 4: Enable USB Storage

To activate usb storage on your ubuntu machine run given command.

sudo modprobe usb_storage

Conclusion

We have successfully installed PHP using Ansible playbook on ubuntu 22.04 LTS, Kindly report in case you are facing defeculties with follwing details.

  • OS name
  • OS version
  • Package name
  • Logs – Error / Warning / failed

Get in touch with our new devops tools based website- https://www.devopstricks.in/

How to disable usb storage in ubuntu 16.04 | 18.04 | 20.04

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top