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 |
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. |
|
 |
08-01-2008, 10:23 AM
|
#1
|
|
Member
Registered: Dec 2005
Location: Boston, USA
Distribution: Kubuntu, Debian
Posts: 78
Rep:
|
sudo requires current user's password
Just installed Fedora 9 on my laptop and I noticed that upon running sudo it asks me for the password of the current user, not the root password. I thought that this was the whole point of having a root user, that normal users could not perform certain operations without knowing the root password?
It denied my operation, which I believe is because the current user was not listed in /etc/sudoers. If I add this user to sudoers, does this give the account the same privileges as root?
|
|
|
|
08-01-2008, 10:35 AM
|
#2
|
|
Senior Member
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,843
Rep: 
|
In a way, yes. However, with sudo you can have much more fine grained control over what an ordinary user can do when comapred to using su.
In general, when a user uses su, they effectively become root; when a user uses sudo, they are allowed to run specific commands as root (if the sudoers file allows). For instance, I have my sudoers file set up so that I (as an ordinary user) can shutdown and reboot the machine from the command line using sudo /sbin/shutdown. This doesn't mean I can run any command as root, only certain ones.
|
|
|
|
08-01-2008, 11:32 AM
|
#3
|
|
Member
Registered: May 2007
Distribution: Debian
Posts: 754
Rep:
|
As pwc101 said, su requires the root user password and sudo requires a regular user password. What you can or can't do with sudo, depends on how you set up your sudoers file. Some distros (no finger-pointing) do this:
Code:
# User privilege specification
regular-user-name ALL=(ALL) ALL
That gives that regular user full root power. However, you can define it in a much more specific way, and at many levels. Check man sudoers for all the gory details.
By the way, I strongly recommend that you never edit /etc/sudoers directly. Use the wrapper visudo instead - if your system has it. It prevents you from saving the file if there are syntax errors, which is useful.
|
|
|
|
08-03-2008, 05:22 AM
|
#4
|
|
Member
Registered: Sep 2007
Location: Folsom, California
Distribution: Debian 4.0 (Etch), Debian 5.0 (Lenny), Ubuntu 8.04
Posts: 297
Rep:
|
Just a minor side-note. Ubuntu doesn't allow access to root... but...
if you:
sudo su root
you can. interesting - you can even change the root password that way. I believe you can setup sudo to use either the user's password or the root password, but you'd have to double check that.
man visudoer
man sudoers
|
|
|
|
08-04-2008, 03:27 AM
|
#5
|
|
Guru
Registered: Aug 2004
Location: Brisbane
Distribution: Centos 6.4, Centos 5.9
Posts: 15,026
|
The Ubuntu method is nonstd wrt Unix/Linux, which puts some (eg me) off.
The std is
su -
<root passwd>
logs you in as root with root's env
su
<root passwd>
(note lack of '-') logs you in as root BUT with your orig user's env.
sudo is designed to enable you to allow a non-root user to perform one or more cmds that would normally require root powers. Note that usually its set to ask for user's passwd for obvious reasons.
|
|
|
|
08-04-2008, 08:14 AM
|
#6
|
|
Member
Registered: Dec 2005
Location: Boston, USA
Distribution: Kubuntu, Debian
Posts: 78
Original Poster
Rep:
|
Thanks for all of the responses, I feel like I learn more about linux every time that I use it, and you guys are incredibly helpful.
The reason I was asking this question was in relation to getting audio/video files to play, but I ended up stumbling upon this post instead.
|
|
|
|
| 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:00 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
|
|