Shell session output to screen and file
Hi
I've been reading and playing and reading and playing and still can't crack this puppy.
Basically, I would like for the contents of a users session to be logged to a file (and screen so they can see what they are doing).
I started with 'script' but got stuck when trying to exit the 'script' command and the shell at the same time.
Then I tried with output redirection but only managed to get one or the other redirected.
Any ideas guys?
Cheers in advance
Message was edited by:
bashdem
[552 byte] By [
bashdem] at [2007-11-26 11:52:24]

# 2
Ok, I have seen some suggestions using the tee command but I want not only the commands run but also the output all logged to a file.
ie. I need the whole input and output of a users session logged to a text file. From the moment they log in to the moment they close their shell session.
Cheers
# 3
Hi
> I started with 'script' but got stuck when trying to
> exit the 'script' command and the shell at the same
> time.
The best way to capture the shell session is to use "script" command. I think you will not find any problem in using it. Type "exit", to come out of it.
And also, you can use expect to store complete session details in a file and thatcan be reused.
HTH,
Prabu.S
# 6
Soalris Auditing looks good but will this record the output of commands as well as the command run?
I'll elaborate a bit more. The network guys here use a solaris box to log onto routers/switches etc etc. They need an audit trail for each time they log onto the solaris box. ie a text file that shows what commands they ran and the output. so we can see what was done to a router and what condition ports were in when this command was run. etc etc.
I think script will be best but its making it invisible thats the problem.
# 7
two thoughts come to mind.
Years ago I demo'ed a product from "Symark" called PowerBroker. It will capture keystrokes of defined users and store them to a file. It was a little over-kill for my needs.
Also, what if you were to simply alias "exit" to perform "exit; exit". In theory this would give you the double hit of "exit" in a single command. <edit>(Need to work on this....Don't work as planned)<edit>
Message was edited by:
Lee_McCreery