LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 07-04-2006, 08:10 AM   #1
Ephracis
Senior Member
 
Registered: Sep 2004
Location: Sweden
Distribution: Ubuntu, Debian
Posts: 1,109

Rep: Reputation: 50
Thoughts on sudo


Well, I have a thought on sudo.. Both in Gentoo and OpenBSD I have put my user in the wheel group so I can use su and sudo. But I have always wondered why sudo uses the users own password instead of the root one. Cause if a cracker would have cracked my password that will give him full access to the system without having to crack the root password, right?
Shouldn't sudo use the password of the account I am trying to run the command as (root)? Like "su -c cmd"?

It's just a thought I've been having and of course you can claim that as long as we use strong passwords it's safe. But I still think it's strange that sudo skips the root password.
 
Old 07-04-2006, 08:26 AM   #2
spirit receiver
Member
 
Registered: May 2006
Location: Frankfurt, Germany
Distribution: SUSE 10.2
Posts: 424

Rep: Reputation: 33
This is optional, the following setting in /etc/sudoers will make sudo ask for the target user's password.
Code:
Defaults targetpw
 
Old 07-04-2006, 08:35 AM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 683Reputation: 683Reputation: 683Reputation: 683Reputation: 683Reputation: 683
Imagine that you are one of many users on the system and members of a certain group need to run certain root commands. You don't want to give them the root password, because then they could su to root and have full power.

You can configure the /etc/sudoers to deny certain commands. Some commands like mounting or ejecting a cdrom may be allowed for all local users.
 
Old 07-04-2006, 10:45 AM   #4
Ephracis
Senior Member
 
Registered: Sep 2004
Location: Sweden
Distribution: Ubuntu, Debian
Posts: 1,109

Original Poster
Rep: Reputation: 50
Thank you. That cleared it up. So I guess I can use something like a "admin" group and give them access to stuff like shutdown, reboot, mount, etc.. and then add "Defaults:%wheel targetpw" and give users in wheel full access to all commands.

That way users in the wheel group can use the root password to run su or sudo but users in admin can do some administrive stuff without needing to know the root pass.
 
Old 07-04-2006, 04:32 PM   #5
Vgui
Member
 
Registered: Apr 2005
Location: Canada
Distribution: Slackware
Posts: 496

Rep: Reputation: 31
I tend to just use su, if you add an /etc/suauth file and only allow certain users to switch it seems perfectly fine and convient. I've never understood what people are doing that requires constant root access though
 
Old 07-04-2006, 04:40 PM   #6
nadroj
Senior Member
 
Registered: Jan 2005
Location: Canada
Distribution: ubuntu
Posts: 2,539

Rep: Reputation: 60
Quote:
Cause if a cracker would have cracked my password that will give him full access to the system without having to crack the root password, right?
you shouldnt setup sudo so that a normal user can execute all commands as root.. thats what the root account is for. sudo should be used for specific commands, in my opinion. commands, as previously mentioned, such as ejecting a cd drive and shutting down seem like logical commands to be able to have your normal user sudo to. if you have sudo setup like this and someone does gain access to your account, then they cant really break your system.
 
Old 07-05-2006, 10:42 AM   #7
Lotharster
Member
 
Registered: Nov 2005
Posts: 144

Rep: Reputation: 18
If a hacker has cracked the account of a user who uses `su` (or sudo with root password) regularly, it is not very difficult to get the root password. All he must do is write a small bash-script that records the root password the next time the user enters it.
That is the reason why using sudo with the user's password (as ubuntu does it) is in most cases just as secure as using the root password (or su with a proper root account), as long as the user chose a good password.

Besides, even if a hacker gains 'only' user access, he can easily wipe all of the user's personal data, which is usually much harder to replace than reinstalling the OS.
 
  


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
Restricting Editing in Sudo (Advanced Sudo Question) LinuxGeek Linux - Software 4 11-04-2006 03:20 PM
thoughts beekers LinuxQuestions.org Member Intro 1 06-19-2005 03:50 PM
Thoughts on 2.6.10? scuzzman Linux - General 5 12-27-2004 07:34 AM
Need Some Thoughts Please!!! blmartin777 Debian 9 04-23-2004 05:14 PM
Your thoughts... bkeating General 21 12-09-2002 11:07 AM

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

All times are GMT -5. The time now is 07:47 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