LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-02-2003, 08:53 AM   #1
mla
Member
 
Registered: Sep 2003
Location: Canada
Posts: 86

Rep: Reputation: 15
need help with sudo


Hello,
this is my sudoers file. "Test" is the member of "wheel".

# User privilege specification
root ALL=(ALL) ALL
test ALL=(ALL) ALL
# Uncomment to allow people in group wheel to run all commands
%wheel ALL=(ALL) ALL


Here I try to use sudo with root password. Where is the problem?

login as: test
Sent username "test"
test@10.0.0.50's password:
[test@RH9 test]$ sudo shutdown -h now
Password:
Sorry, try again.
Password:

And why when I use su I get :

[test@RH9 test]$ su
Password:
[root@RH9 test]# cd /
[root@RH9 /]# shutdown -h now
bash: shutdown: command not found
[root@RH9 /]#

When I log as root, sure I can shutdown -h now

Thanks.
Michael.
 
Old 10-02-2003, 10:03 AM   #2
spurious
Member
 
Registered: Apr 2003
Location: Vancouver, BC
Distribution: Slackware, Ubuntu
Posts: 558

Rep: Reputation: 31
Try 'su -'; this gives the superuser the same PATH as root; otherwise, you need to do /sbin/shutdown
 
Old 10-02-2003, 10:09 AM   #3
mla
Member
 
Registered: Sep 2003
Location: Canada
Posts: 86

Original Poster
Rep: Reputation: 15
Sorry,
I didn't check previous posts.
With sudo we have to use USER password!!!
I still cannot "shutdown -h now" with sudo and su

Are there some limitations for sudo and su even if
# User privilege specification
root ALL=(ALL) ALL
test ALL=(ALL) ALL
# Uncomment to allow people in group wheel to run all commands
%wheel ALL=(ALL) ALL

and
[test@RH9 test]$ su
Password:
[root@RH9 test]# cd /
[root@RH9 /]# shutdown -h now
bash: shutdown: command not found
[root@RH9 /]#

login as: test
Sent username "test"
test@10.0.0.50's password:
[test@RH9 test]$ sudo shutdown -h now
Password:
sudo: shutdown: command not found
[test@RH9 test]$ login as: test
Password: Login timed out after 60 seconds
[test@RH9 test]$


Thanks.
Michael.
 
Old 10-02-2003, 10:21 AM   #4
fab12&
LQ Newbie
 
Registered: Oct 2003
Location: France
Distribution: Debian sid
Posts: 6

Rep: Reputation: 0
Did you check that /sbin was in your test's user PATH definition? /sbin is were shutdown is and as sudo uses your user's environment it may cause sudo to miss the shutdown command.
 
Old 10-02-2003, 11:05 AM   #5
mla
Member
 
Registered: Sep 2003
Location: Canada
Posts: 86

Original Poster
Rep: Reputation: 15
Thanks for the help.
su - worked.
/sbin worked
 
  


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 03:20 PM
About sudo alnreddy Linux - Security 3 06-13-2005 12:53 PM
su and sudo muman Linux - Security 9 12-30-2004 10:55 AM
sudo pk21 Linux - Newbie 7 10-07-2003 07:53 AM
sudo? nabil Linux - Security 1 02-12-2001 01:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:09 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
Open Source Consulting | Domain Registration