LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-20-2005, 07:01 PM   #1
XaViaR
Member
 
Registered: Dec 2004
Distribution: RHEL, CentOS, SuSE
Posts: 170

Rep: Reputation: 31
sudo


Hello,

I am trying to setup the sudo command. I know that I have to edit the sudoers file with visudo. When I added the following line, I get prompted for a password. From reading docs, I thought the password that I have to enter is the user who has acces for the command. Please can you help.

Below is my sudoers file:

user1 ALL=/sbin/shutdown
user2 ALL=/bin/mount

When, I type "sudo /bin/mount" or "sudo /sbin/shutdown" i have to enter a password. And the only password that works is the root password. Is there a way to fix this? I know that I can use the "NOPASSWD" however, I would like to get prompted for the "user's" password inorder to execute the command.

-X
 
Old 06-20-2005, 07:28 PM   #2
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
My computer asks me for the users password... that's a bit odd. I assume you are running sudo as "user2" and "user1" respectively?
 
Old 06-20-2005, 08:12 PM   #3
XaViaR
Member
 
Registered: Dec 2004
Distribution: RHEL, CentOS, SuSE
Posts: 170

Original Poster
Rep: Reputation: 31
that is correct. do you have any ideas?
 
Old 06-20-2005, 08:14 PM   #4
XaViaR
Member
 
Registered: Dec 2004
Distribution: RHEL, CentOS, SuSE
Posts: 170

Original Poster
Rep: Reputation: 31
I don't know if this will help, but I am running suse 9.1 pro.
 
Old 06-20-2005, 08:39 PM   #5
Brian1
LQ 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: 65
I believe what you need is to add something called ' targetpw ' to your sudoers file. I have never used this option but search the google for it. Some info in man pages. Couple items here at this forum as well. If you figure it out post back here.

Brian1
Google the Linux way at ' http://www.google.com/linux '

Last edited by Brian1; 06-20-2005 at 08:41 PM.
 
Old 06-21-2005, 02:22 PM   #6
XaViaR
Member
 
Registered: Dec 2004
Distribution: RHEL, CentOS, SuSE
Posts: 170

Original Poster
Rep: Reputation: 31
well...thank you for your help brian1. i had to comment-out targetpw from the sudoers file:
below are the lines that i commented out, and then it worked! :-)

# Defaults targetpw # ask for the password of the target user i.e. root
# %users ALL=(ALL) ALL # WARNING! Only use this together with 'Defaults targetpw'!

thanks again for your help!
 
Old 06-21-2005, 06:12 PM   #7
Brian1
LQ 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: 65
Glad to be of help there. Seeing how that works I may make the change to my setup for a learning experience. No one else uses my system but it is nice to know one can do this so no one has root's password and don't need nopasswd option.

Thanks for the knowledge there XaVlaR
Brian1
 
  


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 On
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
su and sudo muman Linux - Security 9 12-30-2004 10:55 AM
sudo pk21 Linux - Newbie 7 10-07-2003 07:53 AM
need help with sudo mla Linux - Software 4 10-02-2003 11:05 AM
sudo? nabil Linux - Security 1 02-12-2001 01:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:34 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