Disable usb port [duplicate]
I want my computer to stop listening on a specific usb port. The problem is that the device connected there keeps disconnecting and reconnecting. I think this may be due to a hardware fault. The usb device is a touch screen. With the watch
command I can verify that it keeps appearing and disappearing.
I've tried both blocking the kernel modules with modprobe
and blocking the specific USB device with udev
. Alas nothing seems to do the trick. What other options do I have?
For reference:
> cat /lib/udev/rules.d/20-block-elan.rules
# ELAN Touchscreen
SUBSYSTEM=="usb", ATTRS{idVendor}=="04f3", ATTRS{idProduct}=="0125", ATTR{authorized}="0"
You can disable specific usb ports. First see which devices are available:
for device in $(ls /sys/bus/usb/devices/*/product); do echo $device;cat $device;done
Which will give you a list of your connected devices for example:
/sys/bus/usb/devices/3-14/product
Logitech G430 Headset
/sys/bus/usb/devices/3-1/product
Razer DeathAdder Elite
/sys/bus/usb/devices/3-2/product
Keyboard G910
/sys/bus/usb/devices/4-3/product
USB 10/100/1000 LAN
If I would want to disable my mouse (Razer DeathAdder Elite from the List above) I would type:
echo suspend | sudo tee /sys/bus/usb/devices/3-1/power/level
And if I would want to turn it on again:
echo on | sudo tee /sys/bus/usb/devices/3-1/power/level