# giving a user permission to read evdev device output [SOLVD]

## mikegpitt

I'm working on a small program that requires regular users to read output from  evdev generated devices (e.g /dev/input/event1).  Everything works fine as root or if I run the program using sudo, but when I run as a user I get "evdev open: Permission denied".

I'm guessing this must have something to do with hal or udev permissions, but am not sure how to properly add the rule needed.

Can someone point me in the right direction of where and how I would add a rule to give users access to the device?  Thanks!Last edited by mikegpitt on Wed Mar 10, 2010 7:23 pm; edited 1 time in total

----------

## gentoo_ram

Here's a rule I have for my Wireless headset volume button:

```
KERNEL=="event*",       NAME="input/%k", ATTRS{name}=="Plantronics Plantronics Headset", MODE="0640", GROUP="event", SYMLINK+="input/headset"

```

That changes the permissions to 0640 and sets the group to "event" and my user is in that group.  You can tweak it to your hearts content.  I put this in /etc/udev/rules.d/10-my-udev.rules.  It even makes a symbolic link so you don't have to guess which "eventxx" device it is.

----------

## mikegpitt

Thanks!  That worked like a charm.  Instead of the name parameter I ended up using the hid param, so my rule looks like this:

```
KERNEL=="event*",  SUBSYSTEM=="input", ATTRS{hid}=="MYDEV000", MODE="0644", GROUP="event", SYMLINK+="input/mydevice"
```

BTW - For anyone reading this thread, I also found a nice command to output all udev parameters for any device (substitute for any device under /dev):

```
udevadm info -a -p  $(udevadm info -q path -n /dev/input/event1)
```

----------

