# Users being able to access USB camera devices

## acidreign

Well, after helping a poor guy (Alxellnt) on gentoo had problems getting a user to be able to read write from the camera using gtkam and gphoto2, the solution after some brain wracking was this.

The problem was, root can do what they wanted with the usb device, users couldnt.

Compile USBFS support into the kernel

Add The line below to /etc/fstab

none /proc/bus/usb usbdevfs auto,user,devmode=0660,devgid=85 0 0

Add the user that you want to be in the USB group (GID=85), which should already be in your /etc/groups

and finally remount the /proc/bus/usb by issuing the command

mount -o remount /proc/bus/usb

And bob should be your uncle.

Hope this helps someone else, because this got me thinking.

----------

## krunk

thank you, I've been battleing this for days! gphoto2 can now access my camera. I still am having problems with gtkam though. At start up I get the following error:

Could not list folders in '/'

More:

 You have to set the port prior initialization of the camera. An error occurred in the io-library ("Unknown port"): No error description available.

I'm digging for this solution now.

----------

## simonbh

I was getting the same error:

 *krunk wrote:*   

> Could not list folders in '/'
> 
>  You have to set the port prior initialization of the camera. An error occurred in the io-library ("Unknown port"): No error description available.

 

I did a "chmod -R 777 /proc/bus/usb" as root, and now it works as a regular user!

----------

## rizzo

Hmm I'm getting this same problem and this solution works but it seems that I had to do it again after disconnecting and reconnecting my digital camera.

Is there a way to make this change permanent?

----------

## rizzo

OK I completely hadn't read the text about the fstab entries.  Adding that fixed my problems.

----------

## kamikaze_gerbil

 *Quote:*   

> 
> 
> Add The line below to /etc/fstab
> 
> none /proc/bus/usb usbdevfs auto,user,devmode=0660,devgid=85 0 0
> ...

 

Thank You! Finally a nice easy way to access the camera that works!

You rule!     :Very Happy: 

----------

## kyron

I have followed the abovementionned instructions without success... This is one that I have never been able to geto  working under Gentoo. I always have to run chmod -R 777 /proc/bus/usb to gain access to my camera. Here are the folder's properties when I plug the camera in:

```
kyron@kyron kyron $ ll /proc/bus/usb/001/

total 0

   0 -rw-r--r--    1 root     root           43 Mar  7 10:26 001

   0 -rw-r--r--    1 root     root           43 Mar  7 10:26 002

   0 -rw-r--r--    1 root     root           52 Mar  7 10:26 003

   0 -rw-r--r--    1 root     root           43 Mar  7 10:26 004

   0 -rw-r--r--    1 root     root           77 Mar  7 10:26 005

   0 -rw-r--r--    1 root     root           57 Mar  7 13:25 007

```

According to dmesg the camera device is: 007

```
usb 1-5.2: new full speed USB device using address 7

ehci_hcd 0000:00:1d.7: qh f774e680 (#0) state 1

```

My fstab seems to be correct:

```
none on /proc/bus/usb type usbdevfs (rw,noexec,nosuid,nodev,devmode=0660,devgid=85)
```

And I am part of the usb group...though note  that the /proc/bus/usb files are not grouped to usb and the mode is not set to 660 (as if the fstab entry is completely ignored...)

Any help would be greatly appreciated!  :Razz: 

----------

