# Scanner only detected as root not as regular user (without rights?)



## Alain De Vos (Jun 28, 2021)

```
#scanimage -L
```
Outputs:

```
device `epson2:libusb:000:008' is a Epson PID 084D flatbed scanner
```


```
#sane-find-scanner -q
```
Outputs:

```
could not fetch string descriptor: No such device (it may have been disconnected)
found USB scanner (vendor=0x04b8 [SEIKO EPSON], product=0x084d [USB MFP]) at libusb:000:008
```

I changed /usr/local/etc/devd/saned.conf to

```
notify 100 {
        match "system" "USB";
        match "subsystem" "INTERFACE";
        match "type" "ATTACH";
        match "cdev" "ugen[0-9].[0-9]";
        match "vendor" "0x04b8";
        match "product" "0x084d";
        action "chown -L cups:saned /dev/$cdev && chmod -L 660 /dev/$cdev";
};
```

My /etc/devfs.rules is

```
[system=10]
add path 'usb/*'    mode 0660 user x group usb
add path 'ugen*'    mode 0660 user x group usb
add path 'ugen*.*'  mode 0660 user x group usb
add path 'usbctl'   mode 0660 user x group usb
add path 'usb*'     mode 0660 user x group usb
add path 'uscan*'   mode 0660 user x group usb
add path 'pass*'  mode 0666 group operator
add path 'xpt*'   mode 0666 group operator
```

My /etc/devfs.conf is

```
link    cd0        cdrom
    link    cd0        dvd
    perm    acd*            0666
    perm    cd*             0666
    perm    da*             0660
    perm    pass*           0666
    perm    xpt*            0666
    perm    uscanner*       0666
    perm    video*          0666
    perm    tuner*          0666
    perm    devstat            0444
    own       /dev/da0      x:operator
    perm      /dev/da0      0660
    own          /dev/cd0        x:operator
    perm      /dev/cd0        0660
    own     vboxnetctl root:vboxusers
    perm    vboxnetctl 0660
```


----------



## bobmc (Jun 28, 2021)

I found a similiar issue with serial port.  The serial port device could be operated by root|wheel but the default permission was incorrect. I needed to run a script before using serial port.

```
#!/bin/sh
echo
echo "----- fix_tty.sh:  set permissions for RS232 or RS485 -----"
uname -mrs
echo "check if RS232 or RS485 uart is present"
ls -lga  /dev/ttyu0
if  [ -e /dev/ttyu0 ]; then
    echo  "has serial port uart"
    chmod  g+rw  /dev/ttyu*
else
    echo  "no serial port 0"
fi
ls -lga /dev/ttyu*
echo  "--------------"

echo "check if USB RS232 or RS485 adapter is present"
ls -lga  /dev/ttyU0
if  [ -e /dev/ttyU0 ]; then
    echo  "has USB serial adapter"
    chmod  g+rw  /dev/ttyU*
else
    echo  "no USB serial adapter"
fi
ls -lga /dev/ttyU*
echo "======== bye ======="
echo
```


----------



## Tieks (Jun 28, 2021)

Is your regular user a member of group usb?


----------



## CuatroTorres (Jun 28, 2021)

Following the desktop installation guide and forum tips, I have always set wheel, operator, video for the main desktop user, so that I can mount the storage devices and login with `su` for temporary sysadmin tasks. In short, the scanner always worked. Is it a bad idea?


----------



## Alain De Vos (Jun 28, 2021)

My regular user is member of groups , usb,wheel,operator,video.


----------



## Tieks (Jun 28, 2021)

If your scanner device in /dev/usb/n.n.n indeed has owner cups and group saned, your regular user needs to be member of group saned too.


----------



## Alain De Vos (Jun 28, 2021)

/dev/usb/0.8.0 is owned by cups:saned.
But my regular user is not member of group saned. I'll try to at it.


----------

