LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 05-02-2006, 12:21 PM   #1
binary_0011
Member
 
Registered: Apr 2006
Location: Singapore
Distribution: RHEL4,FC4,FC5
Posts: 89

Rep: Reputation: 15
sudo question


this is my sudoers file :

___________________________________________________-
# 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
#User_Alias PU = andrew

# Cmnd alias specification
Cmnd_Alias HALT = /usr/sbin/halt
Cmnd_Alias SHELLS = /usr/bin/
# Defaults specification

# Runas alias specification

# User privilege specification
root ALL=(ALL) ALL
#PU ALL= KILL
andrew ALL= SHELLS

# 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
_______________________________________

if i login as andrew, i can do a "sudo shutdown -r now" and it will prompt me for a password. If i enter it correctly, i will able to run the command.

BUT


if i login as david, then i do a "sudo -u andrew showdown -r now" , it will prompt me for a password too, but it keeps saying password is wrong.

I am 100% sure my password is correct.

Anyone knows why?
 
Old 05-02-2006, 12:39 PM   #2
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 271Reputation: 271Reputation: 271
Which password are you entering? david's or andrew's? Wouldn't it be easier to just make david and andrew part of some group, say the shutdown group, and then give any user in that group sudo permission to shutdown?
 
Old 05-02-2006, 12:42 PM   #3
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 271Reputation: 271Reputation: 271
Here's how to give multiple people shutdown capability without even defining a system group (you just make a group in the sudo config file): http://www.debian-administration.org/articles/33
 
Old 05-03-2006, 05:00 AM   #4
Sabinou
Member
 
Registered: Jan 2006
Location: France
Distribution: Debian Wheezy, Webmin + Virtualmin (remote dedi)
Posts: 214

Rep: Reputation: 30
The sudo command never worked for me (MDV2005, MDV2006). The commands su and kdesu work fine, but sudo never worked, never.

Try that : instead of "sudo shutdown -r now", just
- do alt-F2 and "kdesu shutdown -r now"
- or open a terminal, enter su, provide your root password, and then run "shutdown -r now"
 
Old 05-03-2006, 07:59 AM   #5
cs-cam
Senior Member
 
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,544
Blog Entries: 4

Rep: Reputation: 57
Quote:
The sudo command never worked for me (MDV2005, MDV2006). The commands su and kdesu work fine, but sudo never worked, never.
Funnily enough, the sudo command does work suprisingly well when setup correctly.

pljvaldez has a great suggestion, unless there is an overwhelming reason we do not know about for avoiding an extra group, creating a shutdown group is the way to go.
 
Old 05-03-2006, 08:55 AM   #6
mjjzf
Member
 
Registered: Feb 2004
Location: Valby, Denmark / Citizen of the Web
Distribution: Slackware 14.1
Posts: 879

Rep: Reputation: 39
You have the line allowing it commented out... remove # from the line:
# %users localhost=/sbin/shutdown -h now
 
  


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
Restricting Editing in Sudo (Advanced Sudo Question) LinuxGeek Linux - Software 4 11-04-2006 04:20 PM
sudo mv question howarddevore Linux - General 5 08-16-2005 12:59 PM
sudo question satimis Linux - Software 3 12-07-2004 09:47 AM
Sudo question satimis Fedora 6 11-24-2004 09:58 PM
sudo question darthtux Linux - General 1 06-07-2002 03:27 AM


All times are GMT -5. The time now is 09:23 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration