Re: How to use Udev to restrict USB access only to particular set of USB sticks?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[Vilius]
> tomorrow I will play with the code.
the resulting UDEV rules (with reference to works of Adrian Crenshaw),
for those who are interested:

#By default, disable it.
ACTION=="add", SUBSYSTEMS=="usb", RUN+="/bin/sh -c 'for host in
/sys/bus/usb/devices/usb*; do echo 0 > $host/authorized_default;
done'"

#Enable hub devices.
ACTION=="add", ATTR{bDeviceClass}=="09", RUN+="/bin/sh -c 'echo 1
>/sys$DEVPATH/authorized'"

#Other things to enable, do nto forget to add mouse, and other devices.
ACTION=="add", ATTRS{product}=="VendorX", ATTRS{serial}=="0xxxxxx",
RUN+="/bin/sh -c 'echo 1 >/sys$DEVPATH/authorized'"

-- 
/Vilius
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Linux DVB]     [Asterisk Internet PBX]     [DCCP]     [Netdev]     [X.org]     [Util Linux NG]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux