Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here. |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
07-04-2006, 08:10 AM
|
#1
|
Senior Member
Registered: Sep 2004
Location: Sweden
Distribution: Ubuntu, Debian
Posts: 1,109
Rep:
|
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.
|
|
|
07-04-2006, 08:26 AM
|
#2
|
Member
Registered: May 2006
Location: Frankfurt, Germany
Distribution: SUSE 10.2
Posts: 424
Rep:
|
This is optional, the following setting in /etc/sudoers will make sudo ask for the target user's password.
|
|
|
07-04-2006, 08:35 AM
|
#3
|
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
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.
|
|
|
07-04-2006, 10:45 AM
|
#4
|
Senior Member
Registered: Sep 2004
Location: Sweden
Distribution: Ubuntu, Debian
Posts: 1,109
Original Poster
Rep:
|
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. 
|
|
|
07-04-2006, 04:32 PM
|
#5
|
Member
Registered: Apr 2005
Location: Canada
Distribution: Slackware
Posts: 496
Rep:
|
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 
|
|
|
07-04-2006, 04:40 PM
|
#6
|
Senior Member
Registered: Jan 2005
Location: Canada
Distribution: ubuntu
Posts: 2,539
Rep:
|
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.
|
|
|
07-05-2006, 10:42 AM
|
#7
|
Member
Registered: Nov 2005
Posts: 144
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 07:47 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|