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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
04-21-2006, 07:07 PM
|
#1
|
|
Senior Member
Registered: Aug 2003
Location: Berkeley, CA
Distribution: Mac OS X Leopard 10.6.2, Windows 2003 Server/Vista/7/XP/2000/NT/98, Ubuntux64, CentOS4.8/5.4
Posts: 2,986
Rep:
|
Configuring SUDO for users, a.k.a. sudoers
Question: When I run the sudo command as a user (micro420), I am still asked for the ROOT password. How do I accept the user password?
I ran the 'visudo' command to add my name to the list of users that can run the sudo command.
Code:
#User privilege specification
root ALL=(ALL) ALL
micro420 ALL=(ALL) ALL
I also tried doing this and it did not work:
Code:
sudo -u micro420 cat /etc/shadow
|
|
|
|
04-21-2006, 07:25 PM
|
#2
|
|
Guru
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Squeeze (x86)
Posts: 6,092
|
I think when you run sudo that it is asking you for your user password (i.e. sudo nano will prompt you for a password, you should enter your user password).
|
|
|
|
04-21-2006, 07:47 PM
|
#3
|
|
Senior Member
Registered: Aug 2003
Location: Berkeley, CA
Distribution: Mac OS X Leopard 10.6.2, Windows 2003 Server/Vista/7/XP/2000/NT/98, Ubuntux64, CentOS4.8/5.4
Posts: 2,986
Original Poster
Rep:
|
Quote:
|
Originally Posted by pljvaldez
I think when you run sudo that it is asking you for your user password (i.e. sudo nano will prompt you for a password, you should enter your user password).
|
That is my problem to my question. When I use the SUDO command as a USER, it prompts for a password. My user password does NOT work, BUT, if I input my root password, then it works. This defeats the purpose of using sudo.
So my question again: When I run the sudo command as a user (micro420), I am still asked for the ROOT password. How do I accept the user password?
|
|
|
|
04-21-2006, 07:57 PM
|
#4
|
|
Guru
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Squeeze (x86)
Posts: 6,092
|
From the ubuntu wiki:
Let sudo ask for the root password
You can make sudo ask for the root password instead of the user password, you can do this by adding the keyword rootpw to the line in /etc/sudoers that starts with Defaults.
So I guess use visudo as root and then find the line that starts with Defaults and remove the word rootpw... Hopefully this works on whatever distro you're running...
|
|
|
|
04-21-2006, 08:25 PM
|
#5
|
|
Senior Member
Registered: Aug 2003
Location: Berkeley, CA
Distribution: Mac OS X Leopard 10.6.2, Windows 2003 Server/Vista/7/XP/2000/NT/98, Ubuntux64, CentOS4.8/5.4
Posts: 2,986
Original Poster
Rep:
|
Thanks for the reply, but currently my sudo configuration file looks like this:
Code:
#Defaults Specification
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'!
#User Privilege specification
root ALL=(ALL) ALL
micro420 ALL=(ALL) ALL
As you can see, there is no 'rootpw'.
I am using SuSE 10.
This is frustrating (damn you Linux!!!!). I'm not asking for anything complicated, but something rather practical. You would figure that something so simple like this would be well known in the Linux community ...
Lets say you're an administrator and you want to give your user certain special privileges. You wouldn't give them the root password, correct? You'd give them special 'sudo' privileges and make the user input his/her password, or some other password other than the root password.
Last edited by Micro420; 04-21-2006 at 08:27 PM.
|
|
|
|
04-21-2006, 08:47 PM
|
#6
|
|
Moderator
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,903
|
That means that for some reason only know to you
you must have the rootpw flag in the sudoers file.
The behaviour you're describing isn't sudo default,
and it's not ubuntu default, either.
[edit]
Mental note to self: if you have a thread open for
two hours refresh before you start answering[/edit]
Cheers,
Tink
Last edited by Tinkster; 04-21-2006 at 08:50 PM.
Reason: [edit]
|
|
|
|
04-21-2006, 09:05 PM
|
#7
|
|
Senior Member
Registered: Aug 2003
Location: Berkeley, CA
Distribution: Mac OS X Leopard 10.6.2, Windows 2003 Server/Vista/7/XP/2000/NT/98, Ubuntux64, CentOS4.8/5.4
Posts: 2,986
Original Poster
Rep:
|
Perhaps you are correct, Tinkster.
I am using SuSE 10 and I will go post over there. Perhaps the other SuSE users will know.
If anyone has any other suggestions or ideas, please let me know.
|
|
|
|
04-21-2006, 09:09 PM
|
#8
|
|
Member
Registered: Apr 2006
Location: Pittsburgh
Distribution: Debian Sid AMD64
Posts: 296
Rep:
|
Quote:
|
Originally Posted by Micro420
Thanks for the reply, but currently my sudo configuration file looks like this:
Code:
#Defaults Specification
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'!
#User Privilege specification
root ALL=(ALL) ALL
micro420 ALL=(ALL) ALL
As you can see, there is no 'rootpw'.
I am using SuSE 10.
This is frustrating (damn you Linux!!!!). I'm not asking for anything complicated, but something rather practical. You would figure that something so simple like this would be well known in the Linux community ...
Lets say you're an administrator and you want to give your user certain special privileges. You wouldn't give them the root password, correct? You'd give them special 'sudo' privileges and make the user input his/her password, or some other password other than the root password.
|
Ah, this makes sense. "Defaults targetpw" is causing this weird behavior. You should remove everything above the blank line.
|
|
|
|
04-21-2006, 09:26 PM
|
#9
|
|
Senior Member
Registered: Aug 2003
Location: Berkeley, CA
Distribution: Mac OS X Leopard 10.6.2, Windows 2003 Server/Vista/7/XP/2000/NT/98, Ubuntux64, CentOS4.8/5.4
Posts: 2,986
Original Poster
Rep:
|
It worked! Removing the targetpw worked! Thank you!!!!
Now to figure out who to give special users privileges ...
|
|
|
|
04-21-2006, 09:28 PM
|
#10
|
|
Member
Registered: Apr 2006
Location: Pittsburgh
Distribution: Debian Sid AMD64
Posts: 296
Rep:
|
Quote:
|
Originally Posted by Micro420
It worked! Removing the targetpw worked! Thank you!!!!
Now to figure out who to give special users privileges ...
|
Hopefully, you also removed this line:
Code:
%users ALL=(ALL) ALL # WARNING! Only use this together with 'Defaults targetpw'!
Or else everyone can now sudo.
|
|
|
|
04-21-2006, 11:12 PM
|
#11
|
|
Senior Member
Registered: Aug 2003
Location: Berkeley, CA
Distribution: Mac OS X Leopard 10.6.2, Windows 2003 Server/Vista/7/XP/2000/NT/98, Ubuntux64, CentOS4.8/5.4
Posts: 2,986
Original Poster
Rep:
|
Yes, I made sure I deleted the %users line.
Thanks for checking up
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 03:45 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|