From what I understood, the possibility of having a multitude of device types connected to the computer via USB (keyboard, mouse, gadgets, sticks, webcams, ...) is a security risk:
- I connect a USB stick with malware on it.
- The malware says "I'm a keyboard" -> The OS thinks a keyboard is connected.
- The malware can execute arbitrary keystrokes.
It seems to me that it would be pretty simple to prevent this from happening by asking the user every time a USB keyboard gets connected something like "We think a USB keyboard was connected. Due to security concerns we have to ask you: Is this correct?", giving the user the possibility to answer "yes" or "no". When the user clicks on "yes" (with the mouse / with another keyboard) the device is "registered" and can be used. If the user clicks "no", it is not "registered" and thus cannot be used.
Would this work?
Is there a possibility to make Ubuntu handle USB keyboards like this?
udev- instead of automatically loading the keyboard driver for a device, open a GUI instead (see a somewhat-related question here: http://askubuntu.com/questions/531445/only-use-mass-storage-devices-on-a-selected-usb-port-how ). Of course, that brings us back to square 1 - with what do you authenticate the device? Another device, which needs to be authenticated with...turtles all the way down. (my newish laptop has no PS/2 keyboards: even the internal one seems to be connected over USB) – Piskvor left the building Feb 29 '16 at 11:40