allowing users to mount cdrom

Mikko Työläjärvi mbsd at pacbell.net
Sat Jul 3 14:55:55 PDT 2004


On Sat, 3 Jul 2004, jobse wrote:

> Dear List,
> When trying to mount the cdrom I get Operation not permitted.
> sysctl: vfs.usermount=0(what does that mean and how can I *permanently*
> change it to 1)
> I'd rather not set the sticky bit on mount/umount if I mustn't.
>
> suggestions?
> /jobse

vfs.usermount allows non-root users to perform a mount, provided that
they have sufficient access to both device being mounted and the
mountpoint.  Users won't be permitted to do other privileged
operations, such as loading kernel modules, so in some cases the mount
may still fail.

To set vfs.usermount=1 on every boot, add it to /etc/sysctl.conf (see
sysctl.conf(8)).

One way to give access to assorted files and devices to the user
currently logged in on the local console is to use /etc/fbtab (see
fbtab(5)), thus:

   /dev/ttyv0      0600    /dev/acd0
   /dev/ttyv0      0755    /cdrom

When using some GUI based login doohickey (xdm, gdm, kdm, whatever),
there are usually some kind of "pre-session" script where suitable
code can be inserted to tweak permissions on things when someone
is logging in on the local console (unless they are already reading
/etc/fbtab... I dunno, I'm not using a GUI login thingy).

   $.02,
   /Mikko


More information about the freebsd-questions mailing list