Linux - GeneralThis 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.
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.