Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Feb 2015 21:33:34 +0000
From:      Dave <dave@dgmm.net>
To:        freebsd-questions@freebsd.org
Subject:   Re: problems mounting camera to download pics ....
Message-ID:  <5161492.5f10mYJAFX@amd.asgard.uk>
In-Reply-To: <54EFA8DE.9050909@hiwaay.net>
References:  <54EF5A28.8010605@hiwaay.net> <CA%2BtpaK0mQjSNRnFsjiE7v1AY39jgtoPUfNvMdyqyUZv0qo1cWg@mail.gmail.com> <54EFA8DE.9050909@hiwaay.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thursday 26 February 2015 17:14:38 William A. Mahaffey III wrote:
> On 02/26/15 15:54, Adam Vande More wrote:
> > On Thu, Feb 26, 2015 at 11:38 AM, William A. Mahaffey III <wam@hiwaay.net>
> > 
> > wrote:
> >> .... I am trying to mount my digital camera to download some pics I just
> >> took. When I do this as root, it works AOK & I got the pics off. However,
> >> when I changed my fstab file to (supposedly) allow regular users to mount
> >> that directory, the mount command fails:
> >> 
> >> 
> >> [wam@kabini1, ~, 11:33:11am] 530 % mount /media/flash/
> >> mount_msdosfs: /dev/da0s1: Operation not permitted
> >> [wam@kabini1, ~, 11:35:58am] 530 %
> >> 
> >> 
> >> relevant lines from my fstab file:
> >> 
> >> 
> >> /dev/da0s1      /media/flash            msdosfs
> >> rw,sync,noauto,longnames,-Lru_RU.UTF-8,users    0       0
> >> # /dev/da0s1    /media/flash            msdosfs
> >> rw,sync,noauto,longnames,-Lru_RU.UTF-8          0       0
> >> 
> >> 
> >> FreeBSD 9.3-RELEASE-p9
> >> 
> >> Not a huge issue, since I can get 'er done as root, but I don't see why
> >> this shouldn't be feasible as a regular user .... TIA & have a nice,
> >> snowy
> >> (here) day ;-) ....
> > 
> > sysctl vfs.usermount=1
> 
> Already tried, didn't work, however someone else suggested setuid on
> /sbin/(u)mount & that worked .... Thanks :-) ....

Rather than giving every user root level access to mount (possible security 
issue), the more correct way is to create devfs rules, see the FreeBSD 
Handbook:

https://www.freebsd.org/doc/en/books/handbook/usb-disks.html

This will be how you set up other USB devices to allows user access, eg 
pen/thumb drives, printers, scanners etc.

It's also possible to get "clever" and mount devices on insertion or to 
specific mount points or to run specific commands on insertion, eg system 
detects your camera and copies or moves the files to a specific location.
See devd/devd.conf for info on this.

Google on the terms:

    freebsd user mount usb device

for lots more useful and helpful advice/troubleshooting.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5161492.5f10mYJAFX>