Mounting USB camera on Ubuntu

5,534

The /etc/fstab line

usbdevfs  /proc/bus/usb  usbdevfs  devmode=0666,noauto 0 0

does not mean the camera specifically. It is for the USB device filesystem, which allows "raw" userspace access to USB devices.

So it does not mean your camera will always be mounted automatically: it allows user-level tools (often based on libgphoto2 ) to access the camera, so any applications won't need special permissions to access it.

However, the suggestion to change the usbdevfs configuration in /etc/fstab is obsolete advice that is most likely not needed.

The documentation for gPhoto says:

4.3.5. USB ports on Linux (obsoleted by udev, dirty world-writable hack)

In ancient times, before the arrival of udev, one usually needed to mount the "usbdevfs" or later "usbfs" to /proc/bus/usb. One particular mount option allowed the whole usb filesystem (i.e. all mice, card readers, and all other USB devices) to be made group or world writeable.

Obviously, this kind of “security” is no security and should thus be avoided. Additionally, since udev exists now, just use udev. You can look up how to shoot yourself in the foot with usbdevfs... where? Well, just use udev. After all, this is almost the year 2007, not 1997.

In year 2018, most modern Linux distributions will automatically grant the necessary usbdevfs permissions to the user logging in locally, so you won't have to do anything. If you need access to your USB devices remotely (e.g. when logging in over SSH), you can usually do that by adding a specific group membership to your user account. This group might be named plugdev: check your distribution's documentation for details.

Here's the command to make your user account a member of the plugdev group:

sudo usermod -a -G plugdev <your username here>
Share:
5,534

Related videos on Youtube

Rui F Ribeiro
Author by

Rui F Ribeiro

Updated on September 18, 2022

Comments

  • Rui F Ribeiro
    Rui F Ribeiro over 1 year

    I have to install this SwissRanger camera on Ubuntu. I am trying to follow their USB mounting instructions.

    From the instructions:

    Modify the usbdevfs entry in /etc/fstab    
    by setting devmode appropriately, for example:
    usbdevfs  /proc/bus/usb  usbdevfs  devmode=0666,noauto 0 0
    

    I am not sure how to obtain the usbdevfs program, and also after which, does it automatically mean that the camera will be automatically mounted everytime I plug in the USB? There is no direct web-link, it is in a folder after running libmesasr-dev-1.0.14-706.i386.deb under the webpage http://www.mesa-imaging.ch/drivers.php

    • Admin
      Admin over 11 years
      Can you give us a link to the instructions you're following?