10-10-2020, 10:13 AM
Method 1:
Open Terminal (Ctrl + T) and insert below command
sudo chmod 000 /media/ #(FOR DISABLE USB)
sudo chmod 777 /media/ #(FOR ENABLE USB)
#The above chmod is nothing but change mode which is a part of UNIX/Linux code mainly used for read or write permission that can be represented by numbers.
Method 2:
#Add a new single line in /etc/modprobe.d/blacklist.conf file. You can use the following command like this:
sudo echo "blacklist usb-storage" >> /etc/modprobe.d/blacklist.conf
#From next time onwards, no one will be able to use the USB ports.
#To re-enable the use of USB port, remove the added line from blacklist.conf.
Open Terminal (Ctrl + T) and insert below command
sudo chmod 000 /media/ #(FOR DISABLE USB)
sudo chmod 777 /media/ #(FOR ENABLE USB)
#The above chmod is nothing but change mode which is a part of UNIX/Linux code mainly used for read or write permission that can be represented by numbers.
Method 2:
#Add a new single line in /etc/modprobe.d/blacklist.conf file. You can use the following command like this:
sudo echo "blacklist usb-storage" >> /etc/modprobe.d/blacklist.conf
#From next time onwards, no one will be able to use the USB ports.
#To re-enable the use of USB port, remove the added line from blacklist.conf.