How to log your SSH session on Linux

To log your ssh session to a file which will be cleared just type the following:

$ ssh user@server | tee /your/log/file.log

or if you just want to append the file simply type

$ ssh user@server | tee -a /your/log/file.log

Remember to change "/your/log/file.log" to your real log path!

If you are using a terminal multiplexer like GNU Screem or Tmux, i believe it's possible to do it straight from there.