LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 04-22-2006, 08:00 PM   #1
magnum81
LQ Newbie
 
Registered: Apr 2006
Posts: 13

Rep: Reputation: 0
su to root works sudo doesn't


When I run "su" and enter the password I get access to a root terminal, but I can't "sudo" a command using the same password that I used to "su". So I su'ed to root and "passwd root" and entered a new username and password, then exited the su'ed session, but "sudo" still doesn't work. I have ubuntu.

Last edited by magnum81; 04-22-2006 at 08:01 PM.
 
Old 04-22-2006, 08:05 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,138

Rep: Reputation: 168Reputation: 168
When you use su you enter the password for the user that you're switching to (in this case root). When you use sudo you enter your own user account's password.

I'm assuming that /etc/sudoers is already set up...
 
Old 04-22-2006, 08:06 PM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914
You're not supposed to enter roots password but your own.
Otherwise it would defeat the whole purpose of sudo.


Cheers,
Tink
 
Old 04-22-2006, 08:12 PM   #4
magnum81
LQ Newbie
 
Registered: Apr 2006
Posts: 13

Original Poster
Rep: Reputation: 0
Thanks, that worked. I guess I didn't understand how sudo works.
 
Old 04-22-2006, 08:29 PM   #5
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914
Quote:
Originally Posted by magnum81
Thanks, that worked. I guess I didn't understand how sudo works.
The purpose of sudo is to give a user the right
to do certain of roots tasks without having
to know roots password. The fact that it prompts
you for your password is another security measure,
assuming that occasionally a user with elevated
rights may forget to lock their screen/terminal
and someone else may exploit that. If you know
for sure that no one will be able to do naughty
things from your account you can add a
NOPASSWD: for yourself ...


Cheers,
Tink
 
  


Reply


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sorry, sudo must be setuid root kurtdriver Fedora 6 10-22-2008 07:47 PM
Permissions in Debian - sudo works, su doesn't (etch/64Studio) greennick Linux - Software 0 09-12-2005 03:04 PM
How to hack sudo to become root lewkh Linux - Security 5 01-08-2005 06:20 AM
Sudo, su and root lesleyb Linux - Security 3 10-18-2004 01:36 PM
SUDO as *non-root* user spratty Linux - Newbie 3 05-19-2004 03:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 02:37 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration