Blog‎ > ‎Tech Blog‎ > ‎

Logging SSH sessions

posted 30 May 2013, 10:34 by Flip Pipe   [ updated 30 May 2013, 10:40 ]
During my work activities, I do a lot of ssh sessions to routers, switches, servers and so on, and I allways miss a simple way to record all activities I done.... some time to track problems I made, sometimes to recall a command done some time ago.

So, with a simple script and one alias I resolve my problem. The script is not very well done and not very robust, but I think for now do a go job.

If you want to use it, download the script and do an alias as this.

alias ssh='~/bin/'

If for some reason you need to use the ssh binary, for example, do a tunnel, just invoke it with the full path.

One goody, to do the logging, I use script command, which can create a time file and with scriptreplay it shows almost the same when the sessions was record.

Show each time I do a ssh session to a machine, it is create one folder, one with the output of the session and other file with the timing information.

Flip Pipe,
30 May 2013, 10:34