I'm looking for a way to set a timeout for this:
transport = paramiko.Transport((host, port))
transport.connect(username = username, password = password)
sftp = paramiko.SFTPClient.from_transport(transport)
sftp.get(remotepath, localpath)
sftp.close()
transport.close()
The connection timeout can be set with the
timeout
parameter of theconnect
function.