LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 03-07-2008, 09:29 AM   #1
steve_f60
Member
 
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???

Thanks,

Steve
 
Old 03-07-2008, 11:26 AM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
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 11:28 AM.
 
  


Reply



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 06: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 09:26 AM
Unable to add users to gproftpd Hammett Linux - Software 0 02-11-2005 11:23 AM
Users unable to use shutdown Jskill007 Slackware 3 09-15-2004 02:54 AM
unable to pm users? bigcletus LQ Suggestions & Feedback 3 06-24-2003 10:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:13 PM.

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