paramiko.SSHException : No existing session ???

S

sa6113

I use this code :

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_ex((hostname, port))
except Exception, e:
print 'Connect failed: ' + str(e)
traceback.print_exc()
sys.exit(1)

t = paramiko.Transport(sock)
event = threading.Event()
t.start_client(event)
print "started client"
event.wait(15)

if not t.is_active():
print 'SSH negotiation failed.'
sys.exit(1)
else:
print "SSH negotiation sucessful"

print "doing authentication"
t.auth_password(username, password, event)


event.clear()
event.wait(20)

-----------------
the result is :
started client
ssh negotiation sucessful
donig authentication
.....
paramiko.SSHException : No existing session
 
L

Lawrence D'Oliveiro

sa6113 said:
print "doing authentication" ....

Interesting that these two don't match up. When you're supposed to copy and
paste, you should copy and paste, not type it in.
 
S

sa6113

My problem is in password authentication.

Interesting that these two don't match up. When you're supposed to copy
and
paste, you should copy and paste, not type it in.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top