1. Home
  2. How to block pen drive in Ubuntu PC?

How to block pen drive in Ubuntu PC?

Open Terminal and run below command with root privilege.

$sudo mv /lib/modules/$(uname -r)/kernel/drivers/usb/storage/usb-storage.ko /home/<username>/

Then open /etc/rc.local file using nano editor and add below lines like below picture and reboot the system.

rmmod uas

rmmod usb_storage

Updated on March 21, 2017

Was this article helpful?