Sunday, April 19, 2009

How to log output of remote ssh session ?

There are many instances when you are going to ssh to remote server for troubleshooting and data gathering purposes and you want to save those data in your computer.
There is a less frequently but useful "tee" command which could be used to log all output in a remote ssh session. What it will actually do is that it will generate one file which will capture all the commands as well as their output.

ssh user@remote.server.com | tee /path/of/log/file


This command is very useful for troubleshooting purposes.

4 comments:

Anonymous said...

thanks man .. quite useful

Anonymous said...

this made a task much easier. thanks!

Anonymous said...

It is appropгiate time to make sοme plans for the longer term and it's time to be
happy. I'vе read this рut up аnd іf I maƴ just I wish to сounsel you few
fasсinating issues or suggestions. Peгhaps you can write neҳt aгticles reǥarding
this article. I desire to learn even more tɦings
approximately it!

Have a look at my pagе - parking lotnisko wrocław

Amanuel Nega said...

Thanks for sharing