Detect USB keyboard and other peripherals
Hi there,
I have a Debian machine without any peripherals (no screen, no keyboard, etc.). I'd like to be able to detect and log when someone plugs a USB keyboard. Something like : 2009-07-04 12:21 warning: keyboard pluged!
Is that possible?
I see two ways :
1. Either actively react to the connection of a device and execute a script that logs the alert.
2. Or cron a script that checks for USB devices every 5 minutes.
I have no idea how to do either ways.
Can anyone help me on that?
I would be glad to just be able to alert when any USB device is plugged. No matter if it's a keyboard or a flash key. But if I can make the difference between each device type... Better!
Thanks for your help
Santiago
|