Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Ubuntu] Could not create evdev device: Permission denied #32

Open
JCQuintas opened this issue Mar 20, 2020 · 10 comments
Open

[Ubuntu] Could not create evdev device: Permission denied #32

JCQuintas opened this issue Mar 20, 2020 · 10 comments

Comments

@JCQuintas
Copy link

When I run logid it logs the following error:

[ERROR] Could not create evdev device: Permission denied

It works when I use sudo though, so I wanted to know if there is any way for me to bypass having to use sudo

@PixlOne
Copy link
Owner

PixlOne commented Mar 20, 2020

Try adding the user to the plugdev group and logging back in.

# usermod -a -G plugdev username

@JCQuintas
Copy link
Author

Doesn't seem to have any effect.

@MatthijsvE
Copy link

I have the same problem, the usermod command does not seem to have an effect at my system (Ubuntu 19.10) either. Is there something else that might work?

@pascal-mack
Copy link

Similar Error, mine says:
[ERROR] Could not create evdev device: No such file or directory.
Sudo doesn't help

@nylon86
Copy link

nylon86 commented Jul 3, 2020

same problem of @pascal-mack on manjaro linux

@maxikd
Copy link

maxikd commented Jul 20, 2020

Same on Pop!_OS 20.04. Works fine with sudo

@StefanLobbenmeier
Copy link

From my understanding of linux so far, what you want to do is to check the permissions on the devices that are used, in my case:

WARN] Error adding device /dev/hidraw0: open failed: Permission denied
[WARN] Error adding device /dev/hidraw1: open failed: Permission denied
[WARN] Error adding device /dev/hidraw3: open failed: Permission denied
[WARN] Error adding device /dev/hidraw2: open failed: Permission denied
[WARN] Error adding device /dev/hidraw5: open failed: Permission denied
[WARN] Error adding device /dev/hidraw6: open failed: Permission denied
^C
➜  ~ ls -ashl /dev/hidraw*
0 crw------- 1 root root 237, 0 24. Okt 10:58 /dev/hidraw0
0 crw------- 1 root root 237, 1 24. Okt 10:58 /dev/hidraw1
0 crw------- 1 root root 237, 2 24. Okt 10:58 /dev/hidraw2
0 crw------- 1 root root 237, 3 24. Okt 10:58 /dev/hidraw3
0 crw------- 1 root root 237, 5 24. Okt 10:58 /dev/hidraw5
0 crw------- 1 root root 237, 6 24. Okt 10:58 /dev/hidraw6

You can see that the devices are owned by root and the group root. You will have to change something about this to allow non-root users to access those devices. I will check the wiki of ddcutil what the common way to change this is.

@StefanLobbenmeier
Copy link

StefanLobbenmeier commented Oct 24, 2020

So using https://www.ddcutil.com/config/#grant-readwrite-permission-for-the-devi2c-n-devices-representing-monitors as a reference what you want to do is:

How to resolve permission denied for non-root users

  1. Add a file with the following line to /etc/udev/rules.d (in case of manjaro / arch you want to create a new file in /etc/udev/rules.d)
    sudo nano /etc/udev/rules.d/46-logiops-hidraw.rules
  2. content:
# Assigns the hidraw devices to group hidraw, and gives that group RW access:
KERNEL=="hidraw[0-9]*", GROUP="hidraw", MODE="0660"
  1. Add the group hidraw if it does not already exist:
    sudo groupadd --system hidraw
  2. Add the users who will run logid to that group:
    sudo usermod -G hidraw -a $USER
  3. Restart

@StefanLobbenmeier
Copy link

Afterwards you should see that the devices have the correct group and you no longer get permission denied:

➜  ~ ls -ashl /dev/hidraw*
0 crw-rw---- 1 root hidraw 237, 0 24. Okt 11:32 /dev/hidraw0
0 crw-rw---- 1 root hidraw 237, 1 24. Okt 11:32 /dev/hidraw1
0 crw-rw---- 1 root hidraw 237, 2 24. Okt 11:32 /dev/hidraw2
0 crw-rw---- 1 root hidraw 237, 3 24. Okt 11:32 /dev/hidraw3
0 crw-rw---- 1 root hidraw 237, 5 24. Okt 11:32 /dev/hidraw5
0 crw-rw---- 1 root hidraw 237, 6 24. Okt 11:32 /dev/hidraw6
0 crw-rw---- 1 root hidraw 237, 7 24. Okt 11:32 /dev/hidraw7
0 crw-rw---- 1 root hidraw 237, 8 24. Okt 11:32 /dev/hidraw8
➜  ~ logid
[ERROR] I/O Error while reading /etc/logid.cfg: FileIOException
[INFO] Detected receiver at /dev/hidraw2
[INFO] Device Wireless Mouse MX Master not configured, using default config.
[INFO] Device found: Wireless Mouse MX Master on /dev/hidraw2:1
[INFO] Device Logitech Gaming Keyboard G610 not configured, using default config.
[INFO] Device found: Logitech Gaming Keyboard G610 on /dev/hidraw1:255
[WARN] Error adding device /dev/hidraw3: std::exception
^C

@JCQuintas please let us know if that fixed you issue
@PixlOne please consider adding this somewhere in the wiki / readme

@yrd
Copy link

yrd commented Sep 26, 2021

In case someone else stumbles on this issue with the same problem: the logid process also needs write access to /dev/uinput. I'm not sure if this is documented anywhere else, but I found it here.

My complete udev config now looks like this:

KERNEL=="uinput", GROUP="input", MODE:="0660", OPTIONS+="static_node=uinput"
SUBSYSTEM=="hidraw", ATTRS{idVendor}=="046d", MODE="0660", GROUP="input"

I'm using the input group instead of hidraw, as Stefan did. Also it might be worth noting that I don't use Ubuntu, so it may have worked for the previous commenters because Ubuntu could already be shipping something like the first rule.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants