LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 01-28-2007, 05:34 PM   #1
noonmid27
Member
 
Registered: Sep 2006
Posts: 79

Rep: Reputation: 15
visudo


Hi guys

well i am trying to edit the sudoers file using visudo, i uncommented the lines that prevent users from using the mount command without root password, when i try to mount cd's without root password i still get a message saying that i require the root password. how can i fix this issue.........im trying to do this with suse 10.2 ubuntu and slackware 11.......
 
Old 01-28-2007, 05:42 PM   #2
raskin
Senior Member
 
Registered: Sep 2005
Location: Russia
Distribution: NixOS (http://nixos.org)
Posts: 1,893

Rep: Reputation: 68
Please post the exact line from sudoers and exact command you type. I hope you prepended sudo to the command, for example, and sudoers file does not require users to belong to group you don't have on the box.
 
Old 01-28-2007, 05:48 PM   #3
noonmid27
Member
 
Registered: Sep 2006
Posts: 79

Original Poster
Rep: Reputation: 15
This is what my sudoers file look like.


# sudoers file.
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the sudoers man page for the details on how to write a sudoers file.
#

# Host alias specification

# User alias specification

# Cmnd alias specification

# Defaults specification

# prevent environment variables from influencing programs in an
# unexpected or harmful way (CVE-2005-2959, CVE-2005-4158,
# CVE-2006-0151)
Defaults always_set_home
Defaults env_reset

# In the default (unconfigured) configuration, sudo asks for the root password.
# This allows use of an ordinary user account for administration of a freshly
# installed system. When configuring sudo, delete the two
# following lines:
Defaults targetpw # ask for the password of the target user i.e. root
ALL ALL=(ALL) ALL # WARNING! Only use this together with 'Defaults targetpw'!

# Runas alias specification

# User privilege specification
root ALL=(ALL) ALL

# Uncomment to allow people in group wheel to run all commands
%wheel ALL=(ALL) ALL

# Same thing without a password
%wheel ALL=(ALL) NOPASSWD: ALL

# Samples
%users ALL=/sbin/mount /cdrom,/sbin/umount /cdrom
%users localhost=/sbin/shutdown -h now


well that i did was uncomment the last few lines as you can see.........then i tried to mount a cd and i got the error message.
 
Old 01-28-2007, 05:50 PM   #4
Brian1
Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 61
Looking at other examples in my default sudoers file use it like this.
%users ALL=NOPASSWD: /sbin/ifdown, /sbin/ifup, /bin/mount

Brian
 
Old 01-28-2007, 05:57 PM   #5
raskin
Senior Member
 
Registered: Sep 2005
Location: Russia
Distribution: NixOS (http://nixos.org)
Posts: 1,893

Rep: Reputation: 68
I am not sure if %users includes every user. I guess it is considered ordinary UNIX user group.

Also targetpw is reducing sudo to su in some sense.
 
Old 01-29-2007, 03:23 PM   #6
Brian1
Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 61
Really it is better to just add the users to the wheel group so only a few have usage of certain commands instaed of giving it to all. Or create addtional groups and ad users to it and limit the commands.

Brian
 
Old 02-23-2007, 04:21 PM   #7
Mojojo
Member
 
Registered: May 2003
Location: Philadelphia/PA
Distribution: Mint/Debian
Posts: 447

Rep: Reputation: 32
Could anyone post there sudoers file? Smb4k screwed mine all up.

Last edited by Mojojo; 02-23-2007 at 04:23 PM.
 
Old 02-23-2007, 04:33 PM   #8
raskin
Senior Member
 
Registered: Sep 2005
Location: Russia
Distribution: NixOS (http://nixos.org)
Posts: 1,893

Rep: Reputation: 68
Code:
# sudoers file.
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the sudoers man page for the details on how to write a sudoers file.
#

# Host alias specification

# User alias specification

# Cmnd alias specification

# Defaults specification

# Runas alias specification

# User privilege specification
root    ALL=(ALL) ALL

# Uncomment to allow people in group wheel to run all commands
# %wheel        ALL=(ALL)       ALL

# Same thing without a password
# %wheel        ALL=(ALL)       NOPASSWD: ALL

# Samples
# %users  ALL=/sbin/mount /cdrom,/sbin/umount /cdrom
# %users  localhost=/sbin/shutdown -h now

%wheel  ALL= NOPASSWD: /bin/mount /dev/cdrom -t iso9660 /mnt/cdrom,\
    /sbin/ldconfig
 
Old 02-23-2007, 04:42 PM   #9
Mojojo
Member
 
Registered: May 2003
Location: Philadelphia/PA
Distribution: Mint/Debian
Posts: 447

Rep: Reputation: 32
Thanks for the quick response
 
  


Reply


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
Save Visudo and exit acbenny Linux - General 7 05-05-2011 12:33 PM
Help with sudoers file (visudo) jasongunnisthedevil Linux - Security 1 01-20-2006 11:38 PM
visudo and pico crud Slackware 3 03-16-2005 04:51 AM
Need help with visudo powadha Debian 2 12-19-2004 05:04 AM
visudo xviddivxoggmp3 Slackware 7 08-17-2004 08:19 PM


All times are GMT -5. The time now is 07:32 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration