Chinaunix首页 | 论坛 | 博客
  • 博客访问: 317586
  • 博文数量: 104
  • 博客积分: 3025
  • 博客等级: 中校
  • 技术积分: 1150
  • 用 户 组: 普通用户
  • 注册时间: 2005-02-02 11:12
文章分类

全部博文(104)

文章存档

2013年(1)

2011年(2)

2010年(30)

2009年(29)

2008年(8)

2007年(15)

2006年(17)

2005年(2)

我的朋友

分类:

2010-05-20 17:44:40

介绍:
Rootsh is a wrapper for shells which logs all echoed keystrokes and terminal output to a file and/or to syslog. It's main purpose is the auditing of users who need a shell with root privileges. They start rootsh through the sudo mechanism.

Download Page: 

普通用户在通过sudo /usr/local/rootsh/bin/rootsh -u root变更为root权限后,会将所有的操作指令和终端输出记录下来(如不指定,默认为/var/log/messages),在记录文件中会清晰表明是哪个普通用户变更权限到root。更多内容参考下载解压后的 INSTALL 自述文件

举例:
     两个普通用户: diodemo

/var/log/messages记录:

May 20 17:37:23 PHP_DEV_60 rootsh[07fc9]: dio: dio=root,/dev/pts/6: logging new session (rootsh[07fc9]) to /var/log/rootsh/dio.20100520173723.07fc9
May 20 17
:37:27 PHP_DEV_60 rootsh[07fc9]: dio: 000: Password:
May 20 17
:37:32 PHP_DEV_60 rootsh[07fc9]: dio: 001: [root@PHP_DEV_60 dio]# ls
May 20 17
:37:35 PHP_DEV_60 rootsh[07fc9]: dio: 002: [root@PHP_DEV_60 dio]# pwd
May 20 17
:37:35 PHP_DEV_60 rootsh[07fc9]: dio: 003: /home/dio
May 20 17
:37:50 PHP_DEV_60 rootsh[07f37]: demo: 010: [root@PHP_DEV_60 www]# pwd
May 20 17
:37:50 PHP_DEV_60 rootsh[07f37]: demo: 011: /var/www
May 20 17
:37:53 PHP_DEV_60 rootsh[07f37]: demo: 012: [root@PHP_DEV_60 www]# ls
May 20 17
:37:53 PHP_DEV_60 rootsh[07f37]: demo: 013: icons maven www.jboss.com
May 20 17
:37:53 PHP_DEV_60 rootsh[07f37]: demo: 014: index.php  test

在log中可以看到:
  • dio用户通过/usr/local/rootsh/bin/rootsh -u root变更为root后,执行了ls和pwd指令后,终端输出为/home/dio
  • demo用户执行了ls指令后,记录终端打印当前目录下的文件列表
阅读(2179) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~