LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 820|回复: 1

有没办法让一个后台服务记录下用户的每一个操作?

[复制链接]
发表于 2006-2-10 21:28:05 | 显示全部楼层 |阅读模式
可以的话能指一下路吗,比如用哪个库,看哪些资料,没头絮啊~~~:thank :thank
记下命令行操作也好啊
发表于 2006-2-10 23:50:32 | 显示全部楼层
在 /etc/profile 文件里加上:

HISTFILE=~/.bash_history
HISTSIZE=10000
HISTFILESIZE=999999
# Don't let the users enter commands that are ignored
# in the history file
HISTIGNORE=""
HISTCONTROL=""
readonly HISTFILE
readonly HISTSIZE
readonly HISTFILESIZE
readonly HISTIGNORE
readonly HISTCONTROL
export HISTFILE HISTSIZE HISTFILESIZE HISTIGNORE HISTCONTROL

这里 ~/.bash_history 记录了用户在终端下的所有命令。不包括GUI操作。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表