LinuxQuestions.org
Help answer threads with 0 replies.
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 07-25-2008, 08:17 AM   #1
jeewiz
LQ Newbie
 
Registered: Jan 2007
Distribution: CentOS 6.5
Posts: 21

Rep: Reputation: 0
How can I disable "sudo -s -H"?


I'm running RHEL4, and I'm trying to lock admins out from full access of the root account. I have changed root's entry in /etc/passwd to:

Code:
root:x:0:0:root:/root:/sbin/nologin
This disabled "sudo su -", but not "sudo -s -H". I found a small article from Red Hat http://www.redhat.com/docs/manuals/l...PRIVILEGES-PAM but I can't figure out how to utilize this as I need to. Any ideas?
 
Old 07-25-2008, 01:43 PM   #2
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Quote:
Originally Posted by jeewiz
I'm running RHEL4, and I'm trying to lock admins out from full access of the root account.
You don't have enough thumbs to plug all the holes in that dam.

Even if you prevent sudoers from gaining root's powers in the fashion you describe, there are many, many other ways they can get there. Trivial examples:
  • sudo bash
  • sudo vi (and then run shell commands from within vi)
  • sudo less (and then run shell commands from within less)
  • sudo vi /etc/rc.sysinit (it's a free-for-all upon next reboot...)

The lesson here is you're going to need to be more restrictive with your sudoers. Carefully select the commands they can run based on the jobs they need to perform. (This follows a policy of selectively allowing certain access, and denying all the rest by default.)
 
Old 07-25-2008, 02:01 PM   #3
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
Quote:
Originally Posted by anomie View Post
The lesson here is you're going to need to be more restrictive with your sudoers. Carefully select the commands they can run based on the jobs they need to perform. (This follows a policy of selectively allowing certain access, and denying all the rest by default.)
I'm just going to reiterate that because it's an extremely important point.

If there are certain tasks admins need to perform as a superuser, create macros for them in sudoers and add those macros to the user or group who should be able to execute them.
 
Old 07-25-2008, 02:38 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by chort View Post
create macros for them in sudoers and add those macros to the user or group who should be able to execute them.
I agree more restrictive Sudo is the way but I don't see no macro caps mentioned in the docs? Something new or did you mean something else?
 
Old 07-25-2008, 05:00 PM   #5
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
Like this:
Code:
## Services
Cmnd_Alias SERVICES = /sbin/service, /sbin/chkconfig
...
%wheel ALL = SERVICES
OK, so they're technically called "aliases", not "macros". My bad on the terminology!
 
Old 07-26-2008, 05:59 AM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
NP, I thought I was missing some new feature again...
 
  


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
how to disable "last login log" & disable "last login message" when start login. hocheetiong Linux - Newbie 4 02-08-2011 05:35 AM
cannot "sudo apt-get uptate" or "sudo" anything! plz help mdguy21061 Linux - Newbie 7 04-13-2008 11:59 PM
Difference between "sudo su" and "sudo su -"? Rush_898 Linux - Newbie 1 10-17-2007 02:02 PM
how do I get around the "submit passwd" prompt in ubuntu even if I use "sudo"? t3gah Linux - Distributions 1 02-22-2005 04:42 PM
normal user want to perform "init 6" by using " sudo acbenny Linux - General 3 08-08-2004 07:41 AM

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

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