You are not logged in.
Hi,
I have a python program which accesses a USB device. This works fine when run as 'su' but not as a normal user. I can access USB sticks etc. ok as a normal user.
As a noob, this sounds to me like something connected with Udev rules, but I really have no idea exactly what I need to do to provide the access to the python program as a normal user. Help please
Last edited by chsims1 (2009-01-22 11:31:08)
Offline
try to put your username instead of 0 in the line <policy user="0"> in the file /etc/dbus-1/system.d/hal.conf
and restart hal with:
sudo /etc/rc.d/hal restart
Last edited by biagio (2009-01-22 11:09:24)
Offline
Ok Solved after some reading .....
1. Find where the device is mounted by running dmesg | tail before and after connecting it.
2. Find the vendor and product numbers by using udevadm on the above mount point.
3. Create a new udev rule in /etc/udev/rules.d named 85.usb.rules (use whatever you want as long as it ends in .rules):
SYSFS{idVendor}=="1941", SYSFS{idProduct}=="8021", MODE="0660",GROUP="usb"
4. Create a new group 'usb'
5. Add your normal user to that group.
I realise that the number at the beginning of the udev rule name determines the priority of the rule, but would someone like to suggest a "good" value? It works fine as I have used it here, but I don't want to cause problems further down the line.
Offline
Glad that you found a solution, but I was going to ask if you had added your username to the 'storage' and/or 'disk' groups?
Offline
Yes, I am a member of the storage group ... presumably otherwise I wouldn't have been able to write/read USB sticks. I think the problem was that libusb can only be used by root. Adding the rule allows group (usb) access too.
Offline