The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
sudo, or not sudo: that is the question iBot UNIX and Linux RSS News 1 02-07-2008 01:40 PM
Logging commands and output soliberus SUN Solaris 3 10-25-2007 06:30 AM
code that reads commands from the standard i/p and executes the commands Phrozen Smoke High Level Programming 4 01-22-2007 02:06 AM
sudo logging + NFS hang? neked UNIX for Dummies Questions & Answers 1 03-14-2005 09:48 AM
Sudo reddyb UNIX for Dummies Questions & Answers 1 08-23-2001 04:15 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-07-2002
linuxmtl linuxmtl is offline
Registered User
  
 

Join Date: Nov 2002
Location: Montréal
Posts: 2
Question Logging all commands after a sudo su-

Hi there,

It might seem tricky, I confess.

We use sudo to allow people to initiate priviledged commands (but not all commands) on our Unix systems.

To by pass this, some people initiate the sudo su - command ;

The main issue is to 'know' what those people do when they gain root access.

Is there a way to have a log of all commands done by a user whent they have gained root access? This way, we could at least know what they do.

Regards,
  #2 (permalink)  
Old 11-07-2002
Neo's Avatar
Neo Neo is offline Forum Staff  
Administrator
  
 

Join Date: Sep 2000
Location: Asia Pacific
Posts: 6,672
Logging commands is a part of many packages, including ACL extensions. Your question is too general because you did not specify the OS.

Also, try the logfile options available in the sudoers configuration file and see if there is anything there to help you.

If you restrict the sudo configuration to a bare minimum number of commands per user, you should be ok with standard sudoers logging.

Code:
man sudoers
In other words, you should not give sudoers permission to use vi.

This is discussed in the sudo man page:

Quote:
CAVEATS
There is no easy way to prevent a user from gaining a root shell if that user has access to commands allowing shell escapes.

If users have sudo ALL there is nothing to prevent them from creating their own program that gives them a root shell regardless of any '!' elements in the user specification.

Running shell scripts via sudo can expose the same kernel bugs that make setuid shell scripts unsafe on some operating systems (if your OS supports the /dev/fd/ directory, setuid shell scripts are generally safe).
So... don't give users permissions to programs that allow shell escapes...... Heck, on our systems, no one is allowed to sudo... and if they were, they would be given very limited command privs.... (certainly not vi !)


... and not su
  #3 (permalink)  
Old 11-07-2002
Captain Kirk Captain Kirk is offline
Registered User
  
 

Join Date: Nov 2002
Location: The final frontier
Posts: 3
Re: Logging all commands after a sudo su-

Quote:
Originally posted by linuxmtl
To by pass this, some people initiate the sudo su - command ;
If people can do that then why do they need sudo? I suggest you look at sudoers carefully and set it up correctly so that cannot happen.
  #4 (permalink)  
Old 11-11-2002
linuxmtl linuxmtl is offline
Registered User
  
 

Join Date: Nov 2002
Location: Montréal
Posts: 2
Wink

We use Solaris OS here.

Some of our sudoers have found that they can just enter ;

sudo su -

So they become root.

What bothers us more is the fact that when they have done so they is now way we can trace back each command a user as done while they are root.

I am looking for a way to permit some users do become root (sudo su - or simply su) if we can trace what they do while they are root.

Is this possible?

Regards,
  #5 (permalink)  
Old 11-11-2002
Neo's Avatar
Neo Neo is offline Forum Staff  
Administrator
  
 

Join Date: Sep 2000
Location: Asia Pacific
Posts: 6,672
Yes, you need to configure the sudoers configuration file and restrict what users do and how they are logged.

You have NOT discovered a 'back door' you have SIMPLY not configured sudo and sudoers properly. (see post above).
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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




All times are GMT -4. The time now is 10:35 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0