This question already has an answer here:

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"

marked as duplicate by WinEunuuchs2Unix, karel, Eric Carvalho, Thomas, Kevin Bowen Jul 21 '18 at 21:25

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


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:

Logitech G430 Headset
Razer DeathAdder Elite
Keyboard G910
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

Not the answer you're looking for? Browse other questions tagged or ask your own question.