I'm trying to increase the SSH timeout. The command:
> ssh <host> <command>
I tried to use:
> time ssh -o ConnectionTimeout=10 <host> "sleep 20"
0.044u 0.040s 0:23.99 0.3% 0+0k 0+152io 0pf+0w
But as you can see, it does not timeout after 10 secs.
I'm using the following SSH version:
> ssh --version
ssh.exe: Reflection for Secure IT 7.2.1.99 on x86_64-suse-linux-gnu (64-bit).
How can I set a timeout in the command-line (without updating different files like /etc/ssh/sshd_config
, since I don't have sudo), which increases the default timeout?
The example above was to test if the timeout works (and it didn't). I want to run a job which runs about 20min~. I believe (I might be wrong) that the default timeout kills the job and ends with:
Connection to <host> closed by remote host.
So I belive I need to increase the ssh timeout. I want to increase the ssh timeout using the command-line (since I don't have sudo, and prefer not to update any files) so it won't close the session while running.
Connection to <host> closed by remote host.
is because of a timeout? You can open a session and do nothing (or sleep for, say, 3600 seconds) to make sure that's the case. – Eduardo Trápani Nov 07 '21 at 15:53Connection to <host> closed by remote host.
message indicates that the remote host closed the connection, not yourssh
client. This means that there is nothing you can do with your client that would increase that timeout (if it was a timeout related to the actual SSH connection). Contact the admin of the remote host to figure out why the connection was closed. Note that this could also be due to the shell timing out, or your session reaching a resource limit, or triggering some other reason for terminating the remote shell or connection. – Kusalananda Nov 08 '21 at 09:26