![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Security Discuss UNIX and Linux computer and network security, cybersecurity, cyberattacks, IT security, CISSP, OWASP and more. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Displaying a dialog box using terminal commands | keshav.murthy@r | Shell Programming and Scripting | 1 | 07-16-2008 11:36 AM |
| Can't login root account due to can't find root shell | neikel | AIX | 2 | 01-30-2008 11:07 PM |
| How to allow root login from a specified terminal ? | XP_2600 | SUN Solaris | 3 | 11-27-2006 04:01 AM |
| Terminal Commands | indigoecho | UNIX for Dummies Questions & Answers | 5 | 12-16-2003 01:41 AM |
| won't allow root login from another terminal to my sun | kymberm | UNIX for Dummies Questions & Answers | 3 | 07-03-2003 12:11 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Can any one help me with a script, which runs in background and mails me all the commands entered by root on any terminal for every hour. We have multiple people having root access on the server and creating a mess,i just wanted to monitor all the activity of the root.
|
|
||||
|
The main problem is we have a application testing team and couple of guys have the root access and they think they are admins....unfortunately i am from the unix team who had to support the servers used by testing team. The funniest part is they don't want to use sudo, and i have to cleanup the mess created by them every time.
I thought it would be a great idea to capture the input from standard input,whenever anybody logs in as root. Iam trying to convince them to loose direct root access and use sudo....but these buggers dont seem to agree with me. |
|
|||||
You can set the default login shell as Bash. ![]() This shell is having the tool known as History. ![]() Anyone logged with this shell if execute any command then that command will get stored and appended to /.bash_history file. You can make a script which will mail you the contents of /.bash_history at your will and you will have all commands executed by root with you...... ![]() Hope this will help..... |
|
|||||
|
Quote:
I suppose you could use 'script "/some/log/dir`who am i | awk '{ print $1 }'`-`date`"' ... As for moving the users over to another access model, set up the 'new way' and show the users. You can reassure them that they will retain their su rights to root for now to give them a chance to evaluate the new method. Watch the sulog file and contact the person each time they use su to ask what they tried to do via sudo but couldn't. You can then fix whatever it was (or remind them that the access will be taken away and they should be finidng all the issues before it's too late). Once you have all the problems cleared up, change the password to something only you know. If you meet resistance, talk to your risk team and show them the very big risk involved in having more than one person able to do work as root without being able to trace who did what. Risk guys hate being unable to trace things back to a single person. |
|
|||||
|
Hi.. Smiling Dragon You are right......
![]() It would be a bit tough to distinguish one session from another when two people logged in as root at the same time.... ![]() So, for that I have a solution...... First make Sure that you have sufficient space in / then do following : 1. Make a directory /record. 2. Put following entries in /.bashrc file: x=`tty | cut -c 6- |tr '[/]' '[.]'` if [ ! -d /record ] ; then mkdir -p /record fi if [ ! -f /record/$x ] ; then touch /record/$x fi echo >> /record/$x echo " *********************************** " >> /record/$x echo >> /record/$x script -a /record/$x Now, when anyone will log in to the system each time you are going to get his commands recorded to /record/pts.# file along with time and date of login. Where "#" is the terminal number given by tty command.The commands will get appended to this file (not over written). So, you will have to monitor these files in /record directory regularlly so as to limit their size and growth. No doubt you will have to set default shell as Bash. Hope this will help..... ![]() Cheers.... Last edited by Reboot; 10-21-2008 at 04:56 PM.. |
|
|||||
|
Hi Reboot,
for some reason when I use script (/usr/bin/script) in .bashrc, as soon as the user logs in the shell goes crazy (e.g. CPU 100%) and the output file - typescript in my case - becomes huge. Do you know why? The command 'script' on a command line works just fine, it's the .bashrc that doesn't like it. I am using Debian Etch. |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Tags |
| linux commands |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|