Disabling USB on Endless OS 3

newbie question, but is there a way to disable USB ports on a machine running Endless?

We deployed a few of these machines as kiosks and I’d like to discourage users from plugging drives into them without me cementing them shut. :wink:

Thanks in advance!

Hi there!

There is a way but, as far as I’m aware, only under the command line - can get tricky but I’ll show you an example.

Firstly, you need to open up a terminal and enter:

lsusb

this should give you a list of USB ports / hubs on your machine.

The bit you will be interested in is Device xxx - this is the device ID of any port / device you might want to turn off.

You can turn individual devices off with the following (replacing usbxxx with your device number without any leading zeros):

echo disabled | sudo tee /sys/bus/usb/devices/usbxxx/power/wakeup

echo suspend | sudo tee /sys/bus/usb/devices/usbxxx/power/level

The first line disables USB wakeup and the second disables the port itself.

To revert you should do the following:

echo enabled | sudo tee /sys/bus/usb/devices/usbxxx/power/wakeup

echo on | sudo tee /sys/bus/usb/devices/usbxxx/power/level

Test this on a non-production machine first until you are happy it is working as it should!!

Best of Luck!

Awesome, thank you so much! I will definitely try this out.

Nathan