The USB inhibitor

One more post about my work on the USB inhibitor.

The class, implemented in python works like this: I can block all the new connected USB devices or allow only some devices (like video devices, HID devices etc.) to connect.

In the demo I used one mouse and one stick.

The mouse

The stick

On the next videos you can see how usb-inhibitor works: blocking all devices and how we can enable some of them calling the inhibitor with specific parameters.

First one, all the devices are blocked:

Then allow only mass storage devices:

Allow only HID devices:

And in the last video allow HID and mass storage devices:

Also using the inhibitor class and a system D-bus, I’ve created a gnome-shell-extension that blocks all the the USB devices when is turned on. Also the extension runs even when the screen is blocked (then is turned automatically on to block new devices). You have to trust me that I really connect the devices while is turned on/off.

That was for now, see you in the next post 😀

In real open source, you have the right to control your own destiny.” – Linus Torvalds