LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Libusb devices only accessable as root (https://www.linuxquestions.org/questions/linux-software-2/libusb-devices-only-accessable-as-root-236758/)

qwijibow 09-29-2004 02:17 PM

Libusb devices only accessable as root
 
Hey guys... i used to use the kernel scanner driver in kernel 2.4. allowing normal users to access the scanner was as easy as chmod 666 /dev/scanner0.

however now i am using the libusb interface with kernel 2.6 (gt68xx scanner)

ohh, yeah it IS a usb scanner...

anyways... here's the confusing part...

sane-find-scanner detects my scanner if ran as root, or a normal user... however XSANE and KOOKA only detect the scanner if they are run as root..

what do i need to chmod ?
how do i allow all users access to the scanner ?

ive already chmod 777 the scanner firmware.
ive added my user to the /etc/groups sections "usb" and "scanner"

not sure what else to do ? any ideas ? thankyou.

qwijibow 09-29-2004 03:58 PM

fixed it.... lsusb gave me the address of the usb scanner. then i chmod 666'ed the apropriate /proc/bus/usb files.

mdg 09-29-2004 04:11 PM

There's a script I use to make the devices in /proc/bus/usb/001 executable. I don't know how Gentoo works, but it should be similar. The script comes with sane-backends. Mine is in /home/sane-backends-1.0.14/tools/hotplug, there's a readme file too.

This is the script:
Code:

#!/bin/sh

# This file is part of sane-backends.
#
# This script changes the permissions and ownership of a USB device under
# /proc/bus/usb to grant access to this device to users in the scanner group.
#
# Ownership is set to root:scanner, permissions are set to 0660.
#
# Arguments :
# -----------
# ACTION=[add|remove]
# DEVICE=/proc/bus/usb/001/BBB/DDD
# TYPE=usb

#if [ "$ACTION" = "add" -a "$TYPE" = "usb" ]; then
#  chown root:scanner "$DEVICE"
#  chmod 0660 "$DEVICE"
#fi


# That's an insecure but simple alternative
# Everyone has access to the scanner

# if [ "$ACTION" = "add" -a "$TYPE" = "usb" ]; then
# chmod 0666 "$DEVICE"
#fi

Just uncomment the part you want to use

mdg 09-29-2004 04:15 PM

Looks like you beat me to it. But keep in mind that changing the permissions is only temporary - they will be reset to default at the next boot, and you'll need to change them again (the device entries themselves are also renamed). The sane script takes care of it automatically


All times are GMT -5. The time now is 10:46 AM.