In Linux the risk of viruses are small to nonexistent, however USB sticks automatically mount for reading and writing regardless. There's an easy way in recent Ubuntu distributions to disable USB storage devices. Simply blacklist the kernel driver:
echo "blacklist usb-storage" | sudo tee -a /etc/modprobe.d/blacklist.conf
Then update the initramfs
sudo update-initramfs -u
After that, nobody can use a USB memory stick in that computer, but still allows the administrator(s) to manually load the module and use it.
Another way which is more selective is to note that users who are members of the plugdev group are allowed to access pluggable storage devices so you could just remove any users you don't want to use USB sticks from that group.
Solution verified in Ubuntu 16.04 (Kernel 4.4.0-31-generic).
We have to blacklist the uas (usb as scsi) driver along with the usb_storage driver in case the just blacklisting the usb_storage driver is not working for you. The uas kernel module is loading the usb_storage but seems to be ignoring the blacklisting of the usb_storage driver in modprobe.d.
In Linux the risk of viruses are small to nonexistent, however USB sticks automatically mount for reading and writing regardless. There's an easy way in recent Ubuntu distributions to disable USB storage devices. Simply blacklist the kernel driver:
Then update the initramfs
After that, nobody can use a USB memory stick in that computer, but still allows the administrator(s) to manually load the module and use it.
source is here: http://www.ossramblings.com/disabling_usb_storage_in_linux
Another way which is more selective is to note that users who are members of the plugdev group are allowed to access pluggable storage devices so you could just remove any users you don't want to use USB sticks from that group.
source: here
Solution verified in Ubuntu 16.04 (Kernel 4.4.0-31-generic).
We have to blacklist the uas (usb as scsi) driver along with the usb_storage driver in case the just blacklisting the usb_storage driver is not working for you. The uas kernel module is loading the usb_storage but seems to be ignoring the blacklisting of the usb_storage driver in modprobe.d.
Just rename
storage
tostorage-old
:change the kernel ver in
3.2.0-35-generic-pae
according to yoursThe simple way Login as root open terminal and type the following command
It will ask for root password, give it .
then add the blacklist USB_storage at the last line as follows
Save it and reboot your system.