# Scanner works only as root [solved]

## samo

Hi,

xsane and scanimage -L don't find my scanner. When I'm root scanimage -L returns *Quote:*   

> device `snapscan:libusb:001:002' is a EPSON EPSON Scanner flatbed scanner

 

/etc/udev/rules.d/10-udev.rules looks like this: *Quote:*   

> BUS=="usb", SYSFS{product}=="EPSON Scanner", NAME="usb/scanner", MODE="660", GROUP="scanner"

 

The node is created as follows: *Quote:*   

> # ls -l /dev/usb
> 
> insgesamt 0
> 
> crw-rw---- 1 root scanner 254, 7 15. Aug 20:31 scanner

 

Does someone knows what's wrong?Last edited by samo on Mon Aug 20, 2007 7:47 pm; edited 2 times in total

----------

## Sadako

Is the user you're running as a member of the "scanner" group?

----------

## samo

Yes, the user is in the scanner group.

----------

## samo

Does someone have an idea?

----------

## Sadako

Sorry, meant to get back to you sooner, but I had to go fish my scanner out of my closet.   :Wink: 

Damn thing's dusty as hell.

Anyway, it's working fine for me, but strangely non of the /dev/usb* nodes are owned by the scanner group.

I don't mean to be condescending, but is your user in the usb group too?

what does `mount | grep usbfs` return?

Also, does /usr/sbin/lsusb list the scanner (when run as a normal user)?

There have been a lot of posts about this before, apparently there are quite a few possible causes so you should definitely look through some older forum posts.

Two more questions; what version of udev do you have installed, and are you using pam?

(pam was a typical culprit, IIRC).

----------

## samo

My user is in the scanner group.

 *Quote:*   

> $ mount | grep usbfs
> 
> none on /proc/bus/usb type usbfs (rw)

 

 *Quote:*   

> $ /usr/sbin/lsusb
> 
> Bus 002 Device 003: ID 046a:0001 Cherry GmbH My3000 Keyboard
> 
> Bus 002 Device 002: ID 046a:0003 Cherry GmbH My3000 Hub
> ...

 

I'm using udev 104-r13 and pam 0.78-r5.

----------

## Sadako

 *samo wrote:*   

> My user is in the scanner group.
> 
>  *Quote:*   $ mount | grep usbfs
> 
> none on /proc/bus/usb type usbfs (rw) 

 You mean the usb group?

Anyway, `mount | grep usbfs` here gives

```
usbfs on /proc/bus/usb type usbfs (rw,noexec,nosuid,devmode=0664,devgid=85)
```

Looks like a likely cause to me.

Try running `mount -o remount,rw,noexec,nosuid,devmode=0664,devgid=85 /proc/bus/usb`

----------

## samo

My user is in both groups *Quote:*   

> # groups
> 
> root bin daemon sys adm disk lp wheel floppy audio dialout tape video mysql

 After the following chance the scanner works also for my user *Quote:*   

> # chmod a+rw /proc/bus/usb/001/002

 The following line also works *Quote:*   

> # mount -o remount,rw,noexec,nosuid,devmode=0664,devgid=85 /proc/bus/usb/

 So how can I chance the permissions automatically?Last edited by samo on Fri Aug 17, 2007 5:20 am; edited 2 times in total

----------

## PaulBredbury

 *samo wrote:*   

> # groups
> 
> root ...

 

That's wrong. Run it when you're not the root user.

```
whoami

groups
```

----------

## samo

Sorry, correct is *Quote:*   

> $ groups
> 
> tty lp wheel audio cdrom dialout video games usb users portage burning scanner plugdev

 

----------

## Sadako

Samo, are you happy with this, or are you still looking for the root cause?

You could put the remount command into /etv/conf.d/local.start

----------

## samo

The described workaround is not really practical. I don't understand why the scanner works for users, after  *Quote:*   

> chmod g+rw /proc/bus/usb/001/002

 Why users need write access?

 *Quote:*   

> # lsusb
> 
> Bus 002 Device 004: ID 0d7d:0100 Phison Electronics Corp. PS1001/1011/1006/1026 Flash Disk
> 
> Bus 002 Device 003: ID 046a:0001 Cherry GmbH My3000 Keyboard
> ...

 Why does the scanner need write access for users, but all other devices not?

----------

## Rob1n

 *samo wrote:*   

> Why does the scanner need write access for users, but all other devices not?

 

Are you sure everything else is working fully?  The scanner needs write permissions on the USB device because you need to send scan requests, etc. over the USB bus.  The keyboard & mouse probably don't (though I would've thought you'd need write permissions to toggle the keyboard LEDs) as they're purely input devices.  I'm very surprised that the flash disk works without write permissions.

More of a question is why the /proc/bus/usb filesystem isn't being mounted with full permissions - from looking at /etc/init.d/localmount (where it's mounted from) it looks like it should add the mount options providing have a usb group defined ("getent group usb" is the command it uses to get this).

----------

## samo

I just updated udev to version 114 and now the scanner is not recognized by root *Quote:*   

> # dmesg | grep -i usb
> 
> usbcore: registered new interface driver usbfs
> 
> usbcore: registered new interface driver hub
> ...

 

sane-find-scanner doesn't find anything.

So now I have to solve this problem first.

----------

## samo

After removing the following rule from 10-udev.rules, the scanner was recognized again and now the scanner works also for users. *Quote:*   

> BUS=="usb", SYSFS{product}=="EPSON Scanner", NAME="usb/scanner", SYMLINK="scanner", GROUP="scanner", MODE="0660"

 

----------

