LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 11-07-2005, 02:33 PM   #1
username17
Member
 
Registered: Aug 2004
Location: Norfolk VA
Distribution: Slackware 11
Posts: 230

Rep: Reputation: 30
SU access and the "wheel" group


Hello,
I've used BSD in the past and I have to say I like the way SU access works with the "wheel" group.

I am curious as to how I could enable the same type of security or access restriction in linux, not BSD.

I've looked online and here, all I get is mouse wheel hits. Nothing about how to enable that "feature".

I believe the "wheel" group exists by default on any linux install, but it is essentially not used.
Does anyone know how I can setup the wheel group to restrict SU access in linux?
I'm using slackware if it matters, currently on a 2.4.x kernel.

Thanks,
-Jason
 
Old 11-07-2005, 02:48 PM   #2
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
Actually the wheel group does exist in Slackware, but I think only root is added by default. You need to edit your /etc/group file and include the users you want in that group on the wheel line. I then edited the sudoers file (using visudo) to give the wheel group access to commands using sudo.
 
Old 11-07-2005, 02:57 PM   #3
username17
Member
 
Registered: Aug 2004
Location: Norfolk VA
Distribution: Slackware 11
Posts: 230

Original Poster
Rep: Reputation: 30
Yah,
I am aware that the group "wheel" exists that, however, any user can SU to root regardless of what group they are in.

I want to prohibit access to SU unless the user is in "wheel". That is how it is in BSD, not in linux.

I don't want to give the group "wheel" full sudo access, I want to prohibit SU access from all accounts except my own. Then I'll give myself SUDO access for certain commands that I might need to use.

This keeps anyone else from SUing (or trying) in as root and limits the number of times I actually have to be root. Since it's better to use SUDO than SU, when performing a single or a few tasks that require root access.

I'm not talking about going to these lengths on my lappy, this will be for my server, which will most likely have multiple logins for friends, family, etc.
 
Old 11-07-2005, 03:20 PM   #4
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
Ah, sorry I misunderstood what you were after. Anyway, I think this will do the trick:

Use chown to set the ownership of su to root:wheel and then set the permissions so that only root or the group can execute it (something like 710). I think you need to also set the suid to root (chmod u+s) to get back to the way the su should work. I think this should limit su access to the wheel group, but if anyone has dissenting opinions, I'm sure they'll post.
 
Old 11-07-2005, 03:25 PM   #5
username17
Member
 
Registered: Aug 2004
Location: Norfolk VA
Distribution: Slackware 11
Posts: 230

Original Poster
Rep: Reputation: 30
Ahh,
I wasn't aware of how *BSD implemented that feature, but doing it using file permissions would work.
I'll try that on my laptop to test it out when I get home. Thanks for the input.

Also, if anyone does have an alternative or thinks that isn't the best way, please do tell.
-Jason
 
Old 11-07-2005, 04:03 PM   #6
imitheos
Member
 
Registered: May 2005
Location: Greece
Posts: 441

Rep: Reputation: 141Reputation: 141
Quote:
Originally posted by Hangdog42
Ah, sorry I misunderstood what you were after. Anyway, I think this will do the trick:

Use chown to set the ownership of su to root:wheel and then set the permissions so that only root or the group can execute it (something like 710). I think you need to also set the suid to root (chmod u+s) to get back to the way the su should work. I think this should limit su access to the wheel group, but if anyone has dissenting opinions, I'm sure they'll post.
This is a solution too, but there is a better (imho) solution.

I see that you are using Slackware, so i will describe the Non-PAM way (With the PAM the procedure is almost the same)

If you see the file "/etc/login.defs" there are many options regarding login (as its name implies)

I quote a section from this file (/etc/login.defs)
Code:
#
# If "yes", the user must be listed as a member of the first gid 0 group
# in /etc/group (called "root" on most Linux systems) to be able to "su"
# to uid 0 accounts.  If the group doesn't exist or is empty, no one
# will be able to "su" to uid 0.
#
SU_WHEEL_ONLY   no
This is the default entry. If you change the "no" to "yes" then you will have what you want.
 
Old 11-07-2005, 04:13 PM   #7
username17
Member
 
Registered: Aug 2004
Location: Norfolk VA
Distribution: Slackware 11
Posts: 230

Original Poster
Rep: Reputation: 30
Excellent!

I was hoping it was just a configuration file I could change.

Thanks to the both of you!
-Jason
 
Old 11-07-2005, 04:45 PM   #8
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
Wow. That is a lot more elegant solution than mine. Thanks!
 
Old 11-07-2005, 08:44 PM   #9
primo
Member
 
Registered: Jun 2005
Posts: 542

Rep: Reputation: 34
The only problem with BSD's approach is the fact that the wheel group is gid 0. I wouldn't want to give this gid away and their criticism of the GNU criticism of the wheel approach fails here. Where's the security if you give away this gid? Fortunately, just creating a "su" group and changing the name in /etc/pam.d/su makes it really secure in these systems
 
Old 11-08-2005, 01:27 PM   #10
username17
Member
 
Registered: Aug 2004
Location: Norfolk VA
Distribution: Slackware 11
Posts: 230

Original Poster
Rep: Reputation: 30
I think I understand what you mean. You don't want to give out UID or PID 0, they might not necessarily have the same access rights, but it's close.

Thing is, only I will be in the wheel group. No one else. I essentially want to limit SU attempts to me only, if anyone else NEEDS root access, I'll use sudo.

If I were to "give out" wheel memberships I would make an alternate group for it.
Thanks for the extra info,
-Jason
 
Old 11-08-2005, 01:47 PM   #11
primo
Member
 
Registered: Jun 2005
Posts: 542

Rep: Reputation: 34
Yeah, the wheel group is GID 0 on BSD, but it's not the same thing in Gentoo where it's non-zero. Usually, Linux distributions use the GID 0 to the root group so there's no problem (I think) with all Linux distros
 
Old 11-09-2005, 06:10 PM   #12
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,649
Blog Entries: 4

Rep: Reputation: 3934Reputation: 3934Reputation: 3934Reputation: 3934Reputation: 3934Reputation: 3934Reputation: 3934Reputation: 3934Reputation: 3934Reputation: 3934Reputation: 3934
I've never been thrilled with the idea of wheel for these reasons:
  1. Everybody knows about it. Every script-kiddie on the planet will try to use it.
  2. It's very easy to get suckered into the sheer laziness (imho) of making "your personal account" almost-all-powerful. It should be "an ordinary Joe or Jane in every way."
  3. Wheel is useful if there are a group of system maintenance accounts, but I think that it's much safer to have one "maintenance account" and to have the several maintenance-personnel all know it. Access-Control Lists (ACLs) also make things like this much simpler than they used to be.
  4. If the system maintenance group isn't wheel, that's just one more thing that a script-kiddie would have to guess. And of course, script-kiddies don't guess anything at all.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
The "wheel" group Thaidog Linux - General 1 04-06-2005 09:23 PM
Where does the group name "wheel" come from? rcbarnes Linux - General 3 11-05-2004 10:32 AM
Where does the name of the "Wheel" group come from? rcbarnes Linux - Newbie 0 11-03-2004 11:20 AM
"adduser" not adding users to default group "users" PunkPT Slackware 2 09-23-2004 11:50 AM
"X-MS" cant open because "x-Multimedia System" cant access files at "smb&qu ponchy5 Linux - Networking 0 03-29-2004 11:18 PM

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

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