Monitoring commands given from a tty

CodeHeads ch at code-heads.com
Fri Mar 3 15:30:41 UTC 2006


On Fri, 3 Mar 2006 17:00:53 +0200
<umitkaan.sonal at turkcell.com.tr> wrote:

>  
> Hello,
> 
> I want to follow what a person does, which commands does he/she gives,
> that connects to a certain tty -from ssh- (like pts/6). 
> How can I track/monitor online? Even logging them and investigating
> later can be enough.
> 
> We are using RedHat AS 2.1.
> 
> Regards,
> Kaan
> 

Let's give this a shot.

I believe by default the shell keeps 1000 entries.

$history = views the history of the commands
$history -c = Clears the history

Maybe you can do a cron or a daemon that redirects the list of commands
to a text file.

Something like this:
#!/bin/bash
$history > ~/command_history.txt
$history -c
done

Just a thought. Someone else might have a better idea thou! :)

-- 
Best regards,
~WILL~
Key: http://code-heads.com/keys/ch1.asc 
Key: http://code-heads.com/keys/ch2.asc 
Linux Commands: http://code-heads.com/commands 
Linux Registered User: 406084 (http://counter.li.org/)




More information about the redhat-sysadmin-list mailing list