Go Back   Linux Forums by TotalPenguin! Get linux Help! > Linux > Linux Security

Linux Security Make your Linux box more secure - Learn How

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-20-2008, 01:46 PM
Senior Member
 
Join Date: Jan 2007
Posts: 133
Wanch is on a distinguished road
Default Disable sudo -s

I have several users on my system that have root ability but I would prefer them to only be able to "sudo <command>" rather than "sudo -s" to root. By preventing them "sudo -s" I think I can prevent them from entering certain directories and such.

How do I disable "sudo -s" access to for certain users or is there a better method for this?
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 08-21-2008, 02:20 PM
Tor Tor is offline
Senior Member
 
Join Date: Oct 2007
Posts: 364
Tor is on a distinguished road
Default

If you disable access to the su command will this work? I'm not sure how this can be done.
Reply With Quote
  #3 (permalink)  
Old 11-10-2008, 03:01 PM
Member
 
Join Date: Jul 2008
Posts: 45
tecktalk is on a distinguished road
Default

Hmm.. I am not sure too.. may be it can be done .. I think you should ask our admin about this.. or any senior member.. you find a bit experienced..
Reply With Quote
  #4 (permalink)  
Old 11-11-2008, 04:16 PM
Jordan's Avatar
Administrator
 
Join Date: Nov 2006
Posts: 507
Jordan is on a distinguished road
Default

I've set this up on one of our Linux machines. You add an ALIAS to the commands in /etc/sudoers and later you block the ALIAS. Here is an example:

Alias:
Code:
# Cmnd alias specification
 Cmnd_Alias     DUMPS = /usr/bin/mt, /usr/sbin/dump, /usr/sbin/rdump,\
                        /usr/sbin/restore, /usr/sbin/rrestore
 Cmnd_Alias     KILL = /usr/bin/kill
 Cmnd_Alias     PRINTING = /usr/sbin/lpc, /usr/bin/lprm
 Cmnd_Alias     SHUTDOWN = /usr/sbin/shutdown
 Cmnd_Alias     HALT = /usr/sbin/halt
 Cmnd_Alias     REBOOT = /usr/sbin/reboot
 Cmnd_Alias     SHELLS = /usr/bin/sh, /usr/bin/csh, /usr/bin/ksh, \
                         /usr/local/bin/tcsh, /usr/bin/rsh, \
                         /usr/local/bin/zsh
 Cmnd_Alias     SU = /usr/bin/su
 Cmnd_Alias     PAGERS = /usr/bin/more, /usr/bin/pg, /usr/bin/less
Blocking the user:
Code:
# User privilege specification
root            ALL=(ALL) ALL
UserName       SERVERS = /usr/bin/, !SU, !SHELLS, !HALT, !REBOOT, !SHUTDOWN, !KILL
Again, this is all in /etc/sudoers file.
Reply With Quote
  #5 (permalink)  
Old 11-17-2008, 01:57 PM
Senior Member
 
Join Date: Jan 2007
Posts: 133
Wanch is on a distinguished road
Default

So I can make a cmnd_alias for anything?
Reply With Quote

Sponsored Links
  #6 (permalink)  
Old 11-17-2008, 03:08 PM
Jordan's Avatar
Administrator
 
Join Date: Nov 2006
Posts: 507
Jordan is on a distinguished road
Default

Yup, for just about anything the system can do. It is a great way to give a user access to only one thing (such as restarting) or give them access to everything but block several commands (like "rm -rf /").
Reply With Quote
Reply

Tags
sudo

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Disable MySQL 3306 port Prog Linux Networking 4 09-24-2008 01:16 PM
sudo: must be setuid root mop Linux General 2 08-19-2008 09:02 PM
Disable startup sound? Halo Mac OS X 4 02-26-2008 02:51 PM
sudo apt-get Off Linux General 3 02-23-2008 05:01 PM


All times are GMT. The time now is 11:15 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.