简体   繁体   中英

How do I log inputs and ouputs from an SSH bash session?

I want to build a simple test system that will allow a candidate to SSH into a bash session and which will both log all inputs provided by the candidate and be able to log and evaluate the outputs from those commands.

I want to evaluate whether a candidate will use certain commands and determine which files he has opened and what the output was. In addition I want to see a list of all commands he used and parse the outputs of those commands. I was thinking of creating aliased wrappers over VI/NANO/LESS that would log when a certain file was opened and send it to a central logging/points system.

How would I best go about this?

It is probably a bit of overkill for your requirements, but have you considered using the script utility?

It is specifically intended to log all input and output from a user session, although parsing the output file is not always trivial, especially when raw mode applications (eg Emacs) are involved. You can, however, replay the output file with the scriptreplay program.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM