We have multiple timeouts in the Paramiko library, which seems confusing on which to set when. The doc tried to describe them, but I don't understand their use cases. Like, when should I use one over the other?
timeout
: an optional timeout (in seconds) for the TCP connectbanner_timeout
: an optional timeout (in seconds) to wait for the SSH banner to be presented.auth_timeout
: an optional timeout (in seconds) to wait for an authentication response.timeout
: set command’s channel timeout. See Channel.settimeout
SSHClient.connect
method:
timeout
– TCP connection opening timeout (but maybe also for some other socket operations). But also timeout for SSH negotiation. Default is no timeout.banner_timeout
– After TCP connection is opened, how long to wait for the server to send anything (that is SSH banner). Default is 15 seconds.auth_timeout
– How long to wait for an authentication response (that's imo self-explanatory). Default is 30 seconds.SSHClient.exec_command
method:
timeout
– How long to wait for "exec" channel to open. And subsequently timeout for each output reading. Default is no timeout.