LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 11-22-2008, 03:01 AM   #1
ktek
Member
 
Registered: Sep 2008
Posts: 48

Rep: Reputation: 15
Protect from other sudoers?


Hey.

I'm running a system that recently I started sharing with my roomies. I'd like to give them sudoer powers, so they can actually do things (i'm running Mint 5) but I'd also like to keep them from getting into some of my stuff in ( '/home/USER/foo' for instance ). Is there a way where I can protect certain directory trees from the sudoer list?

Thanks.
 
Old 11-22-2008, 03:28 AM   #2
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
Huh - that's like asking god to just go away.

You can try setting up SELinux, but the best thing to do is to not give people super user access. I really can't imagine why anyone would need root access except for the sysadmin.

Besides, 'sudo' is evil incarnate because if those people have poor passwords, share passwords or whatever, if someone gets into their account they have instant root access with absolutely no effort - they don't even have to guess the root password because sudo doesn't care about that.
 
Old 11-22-2008, 05:52 AM   #3
Telemachos
Member
 
Registered: May 2007
Distribution: Debian
Posts: 754

Rep: Reputation: 60
@ Pinniped: you're assuming that you give the other users global superuser privileges through sudo, but you don't have to do that. Some distros enter user ALL=(ALL) ALL, but you can use sudo much more surgically to give regular users on a shared system some powers, but not others. For example, I use this setup to let my regular user (me) shutdown, reboot and fiddle with the internet configuration without a password at all:
Code:
# Cmnd alias specification
Cmnd_Alias	HALT = /sbin/shutdown
Cmnd_Alias	REBOOT = /sbin/reboot
Cmnd_Alias	NET = /sbin/iwconfig, /sbin/ifconfig, /sbin/ifup, /sbin/ifdown

# User privilege specification
root	ALL=(ALL) ALL
telemachus ALL=NOPASSWD: HALT, REBOOT, NET
Obviously, I have reason to trust myself, but I could force the user to give a password or limit the commands even more. Sudo itself isn't evil; like anything else, some people misuse it.

@ Ktek: First, think about your sentence "I'd like to give them sudoer powers, so they can actually do things." Regular users already can do plenty without root privileges - in fact, they can do nearly everything they need to do. What exactly do you want for them that they can't get at now? After you figure out the things you want to open up for them, read through man sudoers carefully to see how you can give some but not all privileges to users.
 
Old 11-22-2008, 05:56 AM   #4
JosipBroz
Member
 
Registered: Nov 2008
Location: Ljubljana
Distribution: OpenSuSE
Posts: 56

Rep: Reputation: 18
I agree with pinniped. First, I don't think there is a way under the sun to make root not being root. Second, it's simply a wrong approach - you should create a new group instead, say "powerusers", and give them the exact permissions you want them to have.
 
Old 11-22-2008, 06:17 AM   #5
Telemachos
Member
 
Registered: May 2007
Distribution: Debian
Posts: 754

Rep: Reputation: 60
Quote:
Originally Posted by JosipBroz View Post
I agree with pinniped. First, I don't think there is a way under the sun to make root not being root. Second, it's simply a wrong approach - you should create a new group instead, say "powerusers", and give them the exact permissions you want them to have.
You don't understand: sudo can do exactly what you just asked for with your powerusers group. The way that Ubuntu uses sudo is not the only way to use it. You can use sudo to give specific, limited powers. Entering someone on the sudoers list does not necessarily make them root.

Edit - if you look at my sudoers file above, you will see that the user telemachus has some privileges (reboot, shutdown, etc.), but he isn't root. He can't edit /etc/apt/sources.list, he can't delete all the binaries in /bin, etc. Read man sudoers.

Last edited by Telemachos; 11-22-2008 at 06:19 AM.
 
Old 11-22-2008, 06:31 AM   #6
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
Thanks for pointing out that 'sudo' doesn't mean absolute root access. However, on most machines I still wouldn't give people rights to fiddle with the network or shut down the computer. I guess if you want the computer shut down after someone uses it you could give them such a privilege but I never trust people not to do something like a remote reboot or shutdown. Well, it's a (mostly) free world and people can do as they please with their own computers.
 
Old 11-22-2008, 06:47 AM   #7
Telemachos
Member
 
Registered: May 2007
Distribution: Debian
Posts: 754

Rep: Reputation: 60
Quote:
Originally Posted by pinniped View Post
Thanks for pointing out that 'sudo' doesn't mean absolute root access. However, on most machines I still wouldn't give people rights to fiddle with the network or shut down the computer.
I completely agree. The user in this case is me, so I trust him. I wanted to show that sudo isn't all or nothing. You can choose any set of commands, specify one user or a group, and you can also control what password they use to get the privileges (their user password or a root password or a distinct user password, etc.). The example was just a random example, since I had it handy on this machine.

Bottom line for me: sudo is far more powerful than people imagine.
 
Old 11-22-2008, 09:31 AM   #8
estabroo
Senior Member
 
Registered: Jun 2008
Distribution: debian, ubuntu, sidux
Posts: 1,126
Blog Entries: 2

Rep: Reputation: 124Reputation: 124
If you choose to let them edit things make sure you only give them a restricted editor otherwise they'll just be able to shell out and do whatever anyway.
 
Old 11-24-2008, 05:14 AM   #9
ktek
Member
 
Registered: Sep 2008
Posts: 48

Original Poster
Rep: Reputation: 15
@ Pinniped and JosipBroz: I know, root is root. I wasn't asking how to limit root. I was asking about sudo.

I also know that sudo has potential for flagrant abuse. However it's the way my distro is configured, and I'm still too new at this to really know how to effectively personalize my system. I don't think I'll be sticking with mint long enough to really justify deep personalization anyway. It's a rebound distro after battling to install gentoo for a few days, >.< (I learned a lot during that ordeal, including that gentoo users are liars :P "it's really not all that difficult to set up, you just have to read the manual...") and it's on the way out for me.


@ telemachos: Thanks for the tips.

@ estabroo: Where could I read more about shell/editors?
 
Old 11-24-2008, 05:45 AM   #10
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Nah, gentoo is easy - the best doco. No arguments.
Have you thought of chroot jails for your "friends" ???.
 
Old 11-24-2008, 09:38 AM   #11
estabroo
Senior Member
 
Registered: Jun 2008
Distribution: debian, ubuntu, sidux
Posts: 1,126
Blog Entries: 2

Rep: Reputation: 124Reputation: 124
ktek take a look at rvi and rvim, essentially just vi/vim with restrictions like no shell escapes, you also might want to look at rbash which lets you put further restrictions on what can be done in a shell.
 
Old 11-26-2008, 01:59 AM   #12
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
As per the last para of post #3, what do they NEED to do that they can't do anyway. Do you really need to give them sudo (of any cmd)?. It seems unlikely.
 
Old 11-27-2008, 09:52 PM   #13
ktek
Member
 
Registered: Sep 2008
Posts: 48

Original Poster
Rep: Reputation: 15
I think actually, that Telemachos answered all my sudo questions.

Anyway, regarding gentoo, I agree that they are excellent documents. It's just that earnest desire to get it started, and obsessive adhesion step by step is apparently not sufficient to conquer the deep and ancient evil of gentoo installation. XD

Last edited by ktek; 11-27-2008 at 09:53 PM.
 
  


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
sudoers texerasmo Linux - General 3 08-04-2006 09:57 AM
I deleted /etc/sudoers and creates a new file call sudoers but now it doesnt for visu abefroman Linux - Software 1 11-10-2005 05:03 PM
Regarding SUDOERS hinetvenkat Linux - Networking 1 09-02-2005 01:47 PM
sudoers........ help linuxlah Linux - General 4 01-14-2003 11:54 PM
help with /etc/sudoers keevitaja Linux - Newbie 5 08-17-2002 01:00 PM

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

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