Mounting CDs

Ben Smithurst ben at scientia.demon.co.uk
Sat Dec 4 14:35:14 GMT 1999


Mark Ovens wrote:

[mounting CDs when uid != 0]
> Yes, and the answer's always the same - install sudo from the ports or
> get root to mount it for you.

It seems you don't need to. As root,

# chmod a+r /dev/acd0c         (or whatever CD device you use)
# sysctl -w vfs.usermount=1

and if cd9660 is not in your kernel,

# kldload cd9660

after that, any normal user can just,

ben at strontium:~$ mount_cd9660 -r /dev/acd0c ~/cdrom
ben at strontium:~$ mount
/dev/wd0s1a on / (local, writes: sync 15 async 4472)
/dev/wd0s1e on /usr (local, writes: sync 33618 async 82663)
procfs on /proc (local)
magnesium:/usr/src on /usr/src (read-only)
/dev/acd0c on /home/ben/cdrom (local, nodev, nosuid, read-only, mounted by ben)

It may be a good idea to put the three root commands in
/etc/rc.local. This seems like a cleaner solution than using sudo. Doing
the same thing for floppies may be useful for some people, too (I'm sure
you can all work out how to do that).

-- 
Ben Smithurst            | PGP: 0x99392F7D
ben at scientia.demon.co.uk |   key available from keyservers and
                         |   ben+pgp at scientia.demon.co.uk





More information about the Ukfreebsd mailing list