change file permission of a mouse device file permanently
hello.
i am developping an application that needs to poll/read the device file: /dev/input/mouse0 i belong to a group that has no permission to read this file, so i use the following command: sudo chgrp alexandre /dev/input/mouse0 (alexandre is the group that i belong...) now, the problem is that when i restart the computer, or disconnect and reconnect again the mouse, it resets the permissions to default. how can i permanently change the access permission to this kind of device files? i am using kubuntu 6.06 with the latest kernel. also, i checked for udev and devfs and they both seemed to be installed. (at least there are configuration files in /etc/udev and /etc/devfs i am guessing i could change the permission rules in udev, but i can't find where it refers to mouse devices. thank you for your attention, Alexandre |
You could add the mouse group as a secondary user group to your user account.
usermod -G mouse,video,disk,whatever alexandre Or you could use the udev startup script to establish device permissions for the mouse device during system startup. |
thanks for your answer.
maybe it's better to modify the udev script, since the group that has permission to read the device files is by default only 'root'. i've been checking some sites for doing this and i can't find a simple guide to just change this simple aspect. (make the mouse devices files readable to every user...) i'm guessing that this should be quite direct. can you give me a hint on how to do this? thank you |
With udev, it should be something like this:
edit /etc/udev/permissions.rules and go to input devices, modify the line containing KERNEL=="mouse[0-9]*" If it doesn't exist, add it : Quote:
And you need to reboot |
ok thanks nx5000
i will give it a try and post here the result, as soon as possible. alexandre |
i edited the file 40-permission.rules like u suggested, and added that line.
i could not find any LABEL saying "permissions_end" so i inserted in the end of the file. everything is OK now :) i can now read mouse device files by default. thank you for your help!! |
All times are GMT -5. The time now is 01:41 AM. |