ssh's command mode
I want to use ssh to execute a command and to wait endlessly to log everything (in file) that comes as a stream of the connected server.
But unfortunately, in the manual its written "If command is specified, it is executed on the remote host instead of a login shell"
So what happens is that when I specify my command:
ssh user@server "my_command"
It executed the command and the flow of execution returns to bash shell. So basically my session ends right after the command is executed. This happens only in case I specify command in the command line. If I login into ssh manually and then type "my_command", then the session doesn't end.
I want the ssh not to exit, because after "my_command" executes, I want to capture everything in the session.
Does anyone know a way out of this problem?