Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - General
User Name
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.


  Search this Thread
Old 08-01-2008, 10:23 AM   #1
Registered: Dec 2005
Location: Boston, USA
Distribution: Kubuntu, Debian
Posts: 78

Rep: Reputation: 16
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?
Old 08-01-2008, 10:35 AM   #2
Senior Member
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Rep: Reputation: 128Reputation: 128
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.
Old 08-01-2008, 11:32 AM   #3
Registered: May 2007
Distribution: Debian
Posts: 754

Rep: Reputation: 60
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:
# 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.
Old 08-03-2008, 05:22 AM   #4
Registered: Sep 2007
Location: Folsom, California
Distribution: Ubuntu, Mint, Debian, Suse
Posts: 306

Rep: Reputation: 32
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
Old 08-04-2008, 03:27 AM   #5
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.10, Centos 7.5
Posts: 17,615

Rep: Reputation: 2459Reputation: 2459Reputation: 2459Reputation: 2459Reputation: 2459Reputation: 2459Reputation: 2459Reputation: 2459Reputation: 2459Reputation: 2459Reputation: 2459
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

<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.
Old 08-04-2008, 08:14 AM   #6
Registered: Dec 2005
Location: Boston, USA
Distribution: Kubuntu, Debian
Posts: 78

Original Poster
Rep: Reputation: 16
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
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 On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
kernel 2.6.24 in -current requires NVIDIA driver update TNWestTex Slackware 4 03-12-2008 02:04 PM
Adobe Acrobate Reader Requires A Plugin-That Requires Open LDAP That Requires Berkely Old_Fogie Slackware 10 05-08-2006 05:04 AM
Give root access to user's display + sudo problems Ephracis Linux - General 12 01-11-2006 11:25 PM
Recent upgrade requires me to use sudo for gksu joffa Debian 5 07-15-2005 04:33 AM
Sudo User's LinuxRam Linux - General 5 08-19-2004 11:49 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:15 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration