Using, e.g. the following command:
rsync -P -e 'ssh -p 19022' file user@localhost:Downloads/
I'm disconnected from the remote host right afer a few seconds. I'm rarely disconnected from the host, but when a progress bar is live or when something is going on, I'm suddently disconnected. I have to use, e.g. tmux to get back to visualising the progress bar.
It also happens with the following command: watch -n 2 'netstat -patun|grep sshd'
In other words, during a live process, I'm disconnected after a few secs only.
Picture below:
- I connect to the remote host.
- I run tmux on the remote host.
- From the host/tmux, I send a file back to my local machine using rsync.
- Disconnect happens after a few secs.
- I input
tmux attach
to get back into the tmux session.
Basically, any command that I run on the host, that outputs an event currently in progress, triggers a disconnection from the remote. If this command is not run under something like tmux, it is aborted.
ssh
option-v
to get more information.