Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 03-07-2008, 10:29 AM   #1
Registered: Jul 2004
Posts: 43

Rep: Reputation: 15
Users unable to Mount a CD

Hello All,

I have a need for a user to run a script I wrote that contains a section to mount a cd & then later umount it. Running SuSE10 in runlevel3

The user was unable to mount the drive said must be superuser to mount.

I verified the fstab file was correctly configured :

/dev/cdrom /media/cdrom auto ro,noauto,user 0 0

I was able to make this work by changing the permissions on /bin/mount & /bin/umount with a suid ( chmod +s /bin/mount )

The user was then able to mount the cd.

My question is, the suid basically opens the cd for anybody to be able to mount it. I wanted to limit who had the ability. The last thing I tried was visudo the sudoers file as below:

loadqas ALL=NOPASSWD:/bin/mount /media/cdrom,/bin/umount /media/cdrom

Also tried it as :

loadqas ALL=NOPASSWD:/bin/mount,/bin/umount

Shouldn't that have worked with the sudoers change???


Old 03-07-2008, 12:26 PM   #2
LQ Addict
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,896

Rep: Reputation: 352Reputation: 352Reputation: 352Reputation: 352
The sysadmin should edit /etc/sudoers to specify the user by name, and the command that user is allowed to run as root.

Then edit the script to add 'sudo' to the mount command.

The user then runs the script.

Last edited by bigrigdriver; 03-07-2008 at 12:28 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to validate users against Directory Users in RHEL4 Felipe Red Hat 0 10-27-2006 07:39 AM
Unable to Build ELDK3.1 for kernel 2.4.25. On Booting Unable to mount root fs.. kannath Debian 0 05-11-2006 10:26 AM
Unable to add users to gproftpd Hammett Linux - Software 0 02-11-2005 12:23 PM
Users unable to use shutdown Jskill007 Slackware 3 09-15-2004 03:54 AM
unable to pm users? bigcletus LQ Suggestions & Feedback 3 06-24-2003 11:14 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:27 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration