S
sa6113
I use this code :
import paramiko
import socket
hostname = "192.168.1.4"
username = "test"
port = 22
password = ''123456"
# now connect
try:
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect((hostname, port))
except Exception, e:
print 'Connect failed: ' + str(e)
traceback.print_exc()
sys.exit(1)
import paramiko
import socket
hostname = "192.168.1.4"
username = "test"
port = 22
password = ''123456"
# now connect
try:
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect((hostname, port))
except Exception, e:
print 'Connect failed: ' + str(e)
traceback.print_exc()
sys.exit(1)