How can I log all executed commands over SSH on the client machine?
Let's say I'm making a connection to example.com and type the following commands:
$ ls $ touch hello $ mkdir world $ mv hello world/
I want on my client to have all typed commands in a file like this:
ls touch hello mkdir world mv hello world/
My goal is if I make a mistake and break the server, I still can search which command goes wrong. I can't use
~/.bash_logout to save commands after disconnection nor
~/.bash_history because it's server-side. I didn't find anything relevant with
~/.ssh/config so I'm asking here.
To be more clear, if I connect from machine A to machine B, I want to have the history file on machine A.