Couple of thoughts
Remove the kernel module
Code:
mv /lib/modules/$(uname -r)/kernel/drivers/usb/storage/usb-storage.ko /home/somewhere
Use you own path, on arch something like
Code:
/usr/lib/modules/5.0.9-arch1-1-ARCH/kernel/drivers/usb/storage/usb-storage.ko.xz
Blacklist usb storage
Code:
cat /etc/modprobe.d/blacklist.conf
blacklist usb-storage
Or
modprobe -r usb-storage
You can modprobe it back though.
Turn off usb in BIOS/UEFI
Deny access
Grub, in
grub.conf or
menu.lst, add
nousb to kernel line
lsusb to see whats attached, then
Code:
echo "disabled" > /sys/bus/usb/devices/usbX/power/wakeup
echo "suspend" > /sys/bus/usb/devices/usbX/power/level
On this arch box
Code:
cat /sys/bus/usb/devices/usb1/power/wakeup
disabled
I think that you could also do that with
sysctl -w
Then there is
Code:
pacman -Si usbguard
...
Description : Software framework for implementing USB device authorization
policies
Architecture : x86_64
URL : https://github.com/dkopecek/usbguard
Licenses : GPL2
Groups : None
Provides : libusbguard.so=0-64
Depends On : glibc libqb libqb.so=0-64 libsodium libcap-ng protobuf
polkit dbus-glib
...
Download Size : 394.82 KiB
Installed Size : 1514.00 KiB
...
https://wiki.archlinux.org/index.php/USBGuard