porque no se me ocurrió antes? https://github.com/hephaest0s/usbkill/blob/master/usbkill/usbkill.py usbkill is a simple program with one goal: quickly shutdown the computer when a USB is inserted or removed. Events are logged in /var/log/usbkill/kills.log You can configure a whitelist of USB ids that are acceptable to insert and the remove.