paramiko.SSHException : No existing session ???

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • sa6113

    paramiko.SSHException : No existing session ???


    I use this code :

    hostname = "192.168.1. 4"
    username = "test"
    port = 22
    password = '123456'

    # now connect
    try:
    sock = socket.socket(s ocket.AF_INET, socket.SOCK_STR EAM)
    sock.connect_ex ((hostname, port))
    except Exception, e:
    print 'Connect failed: ' + str(e)
    traceback.print _exc()
    sys.exit(1)

    t = paramiko.Transp ort(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.SSHExc eption : No existing session

    -------------------
    I am sure that the username and password exists properly.
    what is the problem??


    --
    View this message in context: http://www.nabble.com/paramiko.SSHEx...p19823051.html
    Sent from the Python - python-list mailing list archive at Nabble.com.

Working...