插入USB HID设备时防止usbhid自动加载 [英] Prevent usbhid from autoloading when USB HID device is plugged in

查看:223
本文介绍了插入USB HID设备时防止usbhid自动加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试(可逆地)在内核版本4.4.16-v7 +的Raspbian Jessie安装上禁用USB HID支持.我们需要将Raspberry Pi安装在半公共空间中,并在电视上显示内容,我们希望至少使其不易被弄乱.

I'm trying to (reversibly) disable USB HID support on a Raspbian Jessie install, kernel version 4.4.16-v7+. We need to have the Raspberry Pi in a semi-public space and display stuff on a TV, and we'd like to make it at least somewhat hard to mess with it.

到目前为止,我已经设法通过rmmod将usbhid模块从内核中移除.在对模块进行rmmod'处理后,tt似乎每次我插入USB键盘或鼠标时,设备驱动程序就会重新加载回内核.

So far I've managed to make the usbhid module removable from the kernel via rmmod. After rmmod'ing the module, tt seems, though, that each time I plug in a USB keyboard or mouse, the device driver gets loaded back into the Kernel.

有什么办法可以防止这种情况?

Is there any way to prevent that?

推荐答案

udev 是最好,最简单的方法,例如,添加新规则: /etc/udev/rules.d/99-disable-usb-hid.rules:

udev is the best and easiest way doing that, add a new rule in e.g.: /etc/udev/rules.d/99-disable-usb-hid.rules:

SUBSYSTEMS=="usb", DRIVERS=="usbhid", ACTION=="add", ATTR{authorized}="0"

并重新启动 udev . 我刚刚在Debian Jessie ARM 4.4.16中对其进行了测试.

and restart udev. I've just tested it in Debian Jessie ARM 4.4.16.

这篇关于插入USB HID设备时防止usbhid自动加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆