pythonparamiko

Paramiko: Whats the difference between various timeouts?


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?

connect method:

  1. timeout: an optional timeout (in seconds) for the TCP connect
  2. banner_timeout: an optional timeout (in seconds) to wait for the SSH banner to be presented.
  3. auth_timeout: an optional timeout (in seconds) to wait for an authentication response.

exec_command method:

  1. timeout: set command’s channel timeout. See Channel.settimeout

Solution

  • SSHClient.connect method:

    SSHClient.exec_command method: