1

I tried by adding below udev rule

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

ACTION=="add", ATTR{idVendor}=="054c" RUN+="/bin/sh -c 'echo 1 >/sys$DEVPATH/authorized'"

But it disabled all usb devices(USB keyboard and mouse).

Kindly suggest how can I allow other devices except storage devices.

1 Answer 1

0

You can use inequality for exceptions:

ACTION=="add", DRIVERS=="usb-storage", ATTRS{idVendor}!="054c", RUN+="/bin/sh -c 'echo 0 >/sys%p/authorized'"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .