using paramiko problem? please help me

Discussion in 'Python' started by sa6113, Oct 26, 2008.

  1. sa6113

    sa6113 Guest

    I want to connect to a Windows machine in my network , using ssh, I use
    paramiko but I have problem in authentication, would you please help me?

    1- I have installed freeSSHD in server machine? Is it necessery ? or may I
    have to install another program?

    2- I have entered server's Ip insted of hostname.Is it correct?

    3- I have creat a user in server machine with a password to connect. Am I
    right?

    4- I use this code in clinet computer? May I need another code for server
    computer?
    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
    authentication failed

    what should I do?
    please help me , I am new in paramiko.
    --
    View this message in context: http://www.nabble.com/using-paramiko-problem--please-help-me-tp20172937p20172937.html
    Sent from the Python - python-list mailing list archive at Nabble.com.
    sa6113, Oct 26, 2008
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. KK
    Replies:
    2
    Views:
    516
    Big Brian
    Oct 14, 2003
  2. sa6113

    ssh problem using paramiko?

    sa6113, Oct 7, 2008, in forum: Python
    Replies:
    1
    Views:
    409
    Johny
    Oct 7, 2008
  3. sa6113

    Re: ssh problem using paramiko?

    sa6113, Oct 8, 2008, in forum: Python
    Replies:
    4
    Views:
    366
    Steve Holden
    Oct 9, 2008
  4. mk
    Replies:
    0
    Views:
    330
  5. MRAB
    Replies:
    0
    Views:
    397
Loading...

Share This Page