You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think this example code might help with this issue. You can add a timeout argument when calling the connect() method to specify the timeout in seconds.
import socket
import paramiko
def main():
#arbitrary connection settings for the purposes of demonstration
ip = "10.0.99.1"
username = "example username"
password = "example password"
port = 22
client = paramiko.SSHClient()
try:
client.connect(ip, port, username, password, timeout=5)
except socket.timeout:
print("Connection Timed out")
print("complete")
main()
Hello!
I am trying to connect to a console via SSH terminal server
When the server port does not have any console connected or the device is powered off the
does not return any output, so the scrip gets stuck. How can I set a short timeout value?
The text was updated successfully, but these errors were encountered: