Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Feb 2005 00:02:57 +0200
From:      Stan Sorochan <stan.de@gmx.net>
To:        freebsd-fs@freebsd.org
Subject:   Re: FreeBSD 5.2 How do I let ordinary users mount floppies, CDROMs and other removablemedia?'
Message-ID:  <200502040002.58114.stan.de@gmx.net>
In-Reply-To: <20050202231927.67882.qmail@web41202.mail.yahoo.com>
References:  <20050202231927.67882.qmail@web41202.mail.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Yes!!!  It's been figured out!

Thanks to great advice in this mailing list!  Many many thanks to those who=
=20
spent their time to write!

So to recap!  In order to be able to mount removable media without su on=20
=46reeBSD 5.X this has to be done:

vfs.usermount=3D1

is to be put into /etc/sysctl.conf

The following lines are to be added to /etc/devfs.conf:

# Allow members of cdrom to mount the ide cdrom
own     acd0    root:cdrom
perm    acd0    0660

# Allow members of floppy group to mount fd
own     fd0     root:floppy
perm    fd0     0660

The follwing lines are to be added to /etc/devfs.rules:

[userbox_usb=3D10]
add path 'da*' mode 0660 group usb
#more of the usb devices are to be added here (scanners, digicams, etc)

The following line is to be added to /etc/rc.conf so that the rules are=20
loaded:

#Load the ruleset that allows mounting of devices for users
devfs_system_ruleset=3D"userbox_usb"

The last thing to do is to make sure that the appropriate modules are loade=
d=20
into the kernel.  If some are not compiled into the kernel, like msdosfs.ko=
=20
or cd9660.ko for example, see /boot/examples/loader.conf for guidance on ho=
w=20
to load them at boot time.  The appropriate lines are to be added to /boot/
loader.conf

That's it!  After that you can have users that don't know the superuser=20
password use cd's, floppies, usb flash drives etc (if you let them of=20
course).=20

The above is just the basics, it can be followed by entries in the /etc/fst=
ab=20
file, automounting setups and even scripts that make flash drive icons appe=
ar=20
on KDE desktop as they become available, and disapear as the flash drive is=
=20
removed...

Did I miss anything?



On Thursday 03 February 2005 16:14, Lowell Gilbert wrote:
> stan.de@gmx.net (Stan Sorochan) writes:
> > Then I do a su, mount the device, unmount it - and now I can mount the
> > device without su rights....
> >
> > OK, that sort of works, but the su part really has to go....  How can I
> > fix that?
>
> The su part is necessary because it loads a kernel module for you.
> I'm guessing that it's the msdosfs module.  Just compile that into
> your kernel, or load it from /boot/loader.conf, and msdosfs support
> will be automatically pre-loaded before your first mount attempt.


On Thursday 03 February 2005 01:19, Arne "W=F6rner" wrote:
> > OK, that sort of works, but the su part really has to go....
> > How can I fix that?
>
> You could write a little shell script and put it in
> /usr/local/etc/rc.d .
>
> This shell script mounts and unmounts the device...
>
> quod erat faciendum. Or not? :-))
>
> -Arne


=2D-=20
Stan Sorochan
www.unixoid.cjb.net



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