Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a USB scale, a USB HID. Currently, when it is plugged in, the permissions only allow the superuser to access it. How can I configure udev to let anybody access this device? I have the vendor and product IDs, but I would like to match it based on the HID type instead.

Right now, I'm having trouble finding any existing rule that applies to this (I grepped for "hidraw" in /lib/udev/rules.d and /etc/udev/rules.d, among other things).

share|improve this question
up vote 11 down vote accepted

Normally, this is done by adding to /etc/udev/rules.d a file maybe named 50-usb-scale.conf with contents like this:

SUBSYSTEM=="usb", ATTR{idVendor}=="HEX1", ATTR{idProduct}=="HEX2", MODE="0666"

Where HEX1 and HEX2 are replaced with the vendor and product id respectively.

To match on the Interface type instead, you could try replacing ATTR{idVendor}=="HEX1", ATTR{idProduct}=="HEX2" with a match for bInterfaceClass being 03 (HID):

SUBSYSTEM=="usb", ATTR{bInterfaceClass}=="03", MODE="0666"

But be warned, that will catch mice and keyboards too.

share|improve this answer
Did the trick! Thanks! – erjiang Jan 30 '11 at 0:26
On ubuntu 14.04 you have to use MODE:="0666", without the colon, the rule does nothing. – EdwinW Jul 26 '14 at 14:00
On 14.04 this file has to have a .rules extension. A file with a .conf extension won't work. – cherno Jun 26 '15 at 5:02
use lsusb -vvv to get the idProduct and idVendor – Xavier13 May 21 at 15:26
Since this question is quite popular in google output... I think it should be ATTRS, not ATTR - at least this change fixed it for me. – infthi Jun 16 at 18:45

In case you need to change (like me) ttyACM0 permissions, this are my settings:

KERNEL=="ttyACM0", MODE="0777"

It failed when I tried to specify the vendor and product ID. I am not sure why.

share|improve this answer
Yeah, the Kernel option works for most HID devices, better than the USB subsystem one – Muriuki David Apr 22 '14 at 12:35

If its a HIDRAW device, you have to

chmod 0666 /dev/hidrawX

where X is the hid device number, e.g hidraw0. you can do

ls /dev/hid*

to see a list :) Or just do

sudo chmod 0666 /dev/hidraw*

to set for all hidraw devices, probably not recommended.

share|improve this answer

Just for the summary:

You may filter for:

  • idVendor
  • idProduct
  • serial

You must use '==' or ':=' for comparing.
You must use '=' to set your desired settings.

You may give a specific device a specific new path in /dev/...

KERNEL=="hiddev*", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="05df", ATTRS{serial}=="1234567", GROUP="cdrom", OWNER="user28", MODE="0640", SYMLINK+="myhid"

Results in:

You can access the device via '/dev/hiddevx' or via '/dev/myhid' easyly, every user in group 'cdrom' may read from the device. Owner 'user28' may read and write.

or simplest:

KERNEL=="hiddev*", ATTRS{idVendor}=="16c0", MODE="0666"

Results in: Every user may access every hiddevice from Vendor 0x16c0

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.