LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 10-04-2015, 11:46 PM   #1
ron7000
Member
 
Registered: Nov 2007
Location: CT
Posts: 248

Rep: Reputation: 26
restricting who can use the su command


let me know if this is a good idea, or a better way.

the /bin/su program is owned by root.root
has permissions -rws-r-x-r-x

if i create a group called 'admin' with some unique group id,
and make /bin/su owned by root.admin
having permissions -rws-r-x---
will that work and not cause other problems?

I remember reading something about a wheel group,
but I had this thought and it seems so much simpler.
 
Old 10-05-2015, 12:01 AM   #2
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,876

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
'sudo' is the genarally accepted solution to the problem it sounds like you are trying to solve.
Changing permissions on critical system binaries usually ends badly.

Last edited by descendant_command; 10-05-2015 at 12:03 AM.
 
Old 10-05-2015, 01:01 AM   #3
HMW
Member
 
Registered: Aug 2013
Location: Sweden
Distribution: Debian, Arch, Red Hat, CentOS
Posts: 773
Blog Entries: 3

Rep: Reputation: 369Reputation: 369Reputation: 369Reputation: 369
Quote:
Originally Posted by descendant_command View Post
Changing permissions on critical system binaries usually ends badly.
^Yes. Don't do that, it will end in misery. Use sudo instead. Simply add the users which you want to grant superuser privileges to the group sudo.

https://wiki.debian.org/sudo
 
Old 10-05-2015, 12:58 PM   #4
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 2,780

Rep: Reputation: 1198Reputation: 1198Reputation: 1198Reputation: 1198Reputation: 1198Reputation: 1198Reputation: 1198Reputation: 1198Reputation: 1198
The misery starts when the su binary gets an update, and the original attributes are restored.
 
1 members found this post helpful.
Old 10-05-2015, 09:23 PM   #5
ron7000
Member
 
Registered: Nov 2007
Location: CT
Posts: 248

Original Poster
Rep: Reputation: 26
thanks,
then it sounds like the best way is to use sudo along with pam and the wheel group,
from what i've read it's
edit /etc/pam.d/su and have

auth required pam_wheel.so

I see i have a system group names wheel is gid 10 so then it's just a matter of adding specific user accounts to the wheel group.
will see how it goes.
 
Old 10-05-2015, 09:33 PM   #6
ron7000
Member
 
Registered: Nov 2007
Location: CT
Posts: 248

Original Poster
Rep: Reputation: 26
http://www.informit.com/articles/art...20968&seqNum=5

Quote:
If you want to implement wheel and protect su against access from non-wheel members, you should also take another step: Change ownership of the su binary to the wheel group and remove public execute permissions, as follows:

chown root.wheel /bin/su

chmod 4750 /bin/su
so now this guy is saying what i was thinking...
 
Old 10-05-2015, 09:54 PM   #7
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
Quote:
Originally Posted by ron7000 View Post
thanks,
then it sounds like the best way is to use sudo along with pam and the wheel group,
from what i've read it's
edit /etc/pam.d/su and have

auth required pam_wheel.so

I see i have a system group names wheel is gid 10 so then it's just a matter of adding specific user accounts to the wheel group.
will see how it goes.
It looks like you are mixing up su and sudo. You set up sudoers in /etc/sudoers, no need to use wheel group, sudo gives you fine grained control over who can do what. Adding user to wheel group is effectively giving root rights.
 
Old 10-06-2015, 12:52 PM   #8
ron7000
Member
 
Registered: Nov 2007
Location: CT
Posts: 248

Original Poster
Rep: Reputation: 26
the [logic] problem i'm running into is requirements being flung out (quantity not quality) and if there is a potential way to offer any kind of perceived increase in security then do it....

i normally use just su and never sudo. the root password is strong and only known by those who are trusted and competent.
for the less competent (and maybe less trusted) then that's where sudo comes in right? say give only those people rights to... do what really?

back to su and perceived increase, the warm fuzzy is oh look we can also restrict who can use su and that's where the wheel group comes in enforced by PAM. that's where i'm at.
 
  


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 an IP rayn0r Linux - Networking 5 12-03-2007 06:07 PM
Restricting vi & shell commands while using "more" command kvvkumar Linux - Software 1 05-14-2007 04:32 AM
Restricting su dellthinker Linux - Security 1 01-21-2007 02:17 PM
Restricting Processes arpanet1969 Linux - Software 1 07-19-2005 12:38 PM
Restricting IP sixth_sense Linux - Networking 1 04-27-2005 08:13 AM

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

All times are GMT -5. The time now is 03:06 AM.

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