Timeout in paramiko (python)

The connection timeout can be set with the timeout parameter (that indicated the number of seconds for the time out as described here) of the connect function.

ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(host, username=username, password=password, timeout=10)
sftp = ssh.open_sftp()
sftp.get(remotepath, localpath)
sftp.close()

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)