Linux系统usb设备白名单

linux系统中怎样根据PID和VID做USB设备的白名单。只有在白名单里的usb设备才能上报数据。像鼠标键盘不在白名单里,插入鼠标键盘要不能上报数据。能实现???

有人开发了现成的代码 usbguard
USBGuard is a software framework for implementing USB device authorization policies (what kind of USB devices are authorized) as well as method of use policies (how a USB device may interact with the system)

https://github.com/USBGuard/usbguard

你的linux系统是自己有源码,然后下载小机端的吗,还是在电脑端的?小机端比较简单,就是在usb hid驱动的probe函数那里面写上限制代码,电脑端我就不是很清楚了。。