LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 08-01-2008, 10:23 AM   #1
robogymnast
Member
 
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
pwc101
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
Telemachos
Member
 
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:
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.
 
Old 08-03-2008, 05:22 AM   #4
checkmate3001
Member
 
Registered: Sep 2007
Location: Folsom, California
Distribution: Ubuntu, Mint, Debian, Suse
Posts: 307

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
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,369

Rep: Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753
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.
 
Old 08-04-2008, 08:14 AM   #6
robogymnast
Member
 
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.
 
  


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
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

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

All times are GMT -5. The time now is 02:19 PM.

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