7.7. Regular Users Can't Mount the CD/DVD Drive
The CD/DVD drive is a critical part of modern personal computers, allowing users to access music, movies, backups, and more. While you may find it best to lock the CD/DVD drive on Linux servers, you need to support it on users' systems. And that is precisely where Linux makes trouble: it generally allows only the root user to mount a filesystem. When a user inserts a CD or DVD, the filesystem associated to the CD/DVD drive has to be mounted before the user has access.
There are two options for giving users access to their drives: running the automounter, or making revisions to the mount command and /etc/fstab file to let non-root users mount the pertinent directories.
7.7.1. Configuring the Automouter
The automounter runs as root when the kernel detects that a new filesystem has appeared and mounts it as root so that it magically appears for the user. As discussed in the previous annoyance, the automounter relies on the /etc/auto.master and /etc/auto.misc configuration files. When you activate the following directive in /etc/auto.master, you'll get a link to /etc/auto.misc:
/misc /etc/auto.misc --timeout=60
Open the /etc/auto.misc file. You'll see a default directive for the CD/DVD drive, such as:
cd -fstype=iso9660,ro,nosuid,nodev :/dev/cdrom
Make sure the automounter reads your revised configuration files by restarting the associated service:
Put the two files together. You've configured the /misc directory in /etc/auto.master and the cd subdirectory in /etc/auto.misc. Test the result. Insert a disk in the CD/DVD drive and run the following command:
7.7.2. Setting Up Mounts by Regular Users
The alternative to the automounter is to configure your /etc/fstab configuration file to allow regular users to mount your CD/DVD drive. Because there is a single group to represent all users in SUSE, the following command works on that distribution.
/dev/hdc /media/cdrecorder users,umask=000 0 0
The users group is available on most distributions, and you can assign the users of your choice to that group. The default Linux Group ID for users is 100.
You'll also need to configure the mount command with SUID permissions, to support access by regular users. It's already configured that way in SUSE and Fedora Core.