Algunos artículos de interés

domingo, enero 29, 2006

How can a non-root user mount and unmount discs?

How can a non-root user mount and unmount discs?

Most mount commands support the users option. If you make an entry such as the following in /etc/fstab:

/dev/sbpcd /mnt/cdrom iso9660 users,noauto,ro

then an ordinary user will be allowed to mount and unmount the drive using these commands:

% mount /mnt/cdrom
% umount /mnt/cdrom

By default the disc will be mounted with some options that help enforce security (e.g. programs cannot executed, device files are ignored). If this is too restrictive you can use additional options (e.g. the "exec" option will enable execution or programs). See the mount man page for details.

Another method is to get the usermount package which allows non-root users to mount and unmount removable devices such as floppies and CD-ROMs, but restricts access to other devices (such as hard disk partitions). It is available on major archive sites.

Yet another option is to use the sudo program which allows users to run selective programs with root privileges.

No hay comentarios: