Paramiko/SSH blues....

Discussion in 'Python' started by Tarun Kapoor, Jan 16, 2008.

  1. Tarun Kapoor

    Tarun Kapoor Guest

    I am using paramiko to do an SFTP file transfer... I was able to connect
    to the remote server using an SFTP client I have just to make sure
    that username and password are working.. But when i try to connect
    using this script it fails ....

    **hostname, username and password are declared.

    # now, connect and use paramiko Transport to negotiate SSH2 across
    the connection
    sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    sock.connect((hostname, port))

    t = paramiko.Transport(sock)
    event = threading.Event()
    t.start_client(event)

    event.wait(15)

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

    event.clear()

    t.auth_password(username=username, password=password,event=event)

    if not t.is_authenticated():
    print "not authenticated"
    output:
    SSH negotiation successful
    not authenticated
     
    Tarun Kapoor, Jan 16, 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. DHR
    Replies:
    8
    Views:
    1,056
    Charles_hans
    Jan 30, 2008
  2. washakie
    Replies:
    0
    Views:
    653
    washakie
    Jan 30, 2008
  3. sa6113

    ssh problem using paramiko?

    sa6113, Oct 7, 2008, in forum: Python
    Replies:
    1
    Views:
    423
    Johny
    Oct 7, 2008
  4. sa6113

    Re: ssh problem using paramiko?

    sa6113, Oct 8, 2008, in forum: Python
    Replies:
    4
    Views:
    403
    Steve Holden
    Oct 9, 2008
  5. loial
    Replies:
    0
    Views:
    422
    loial
    Feb 3, 2009
Loading...

Share This Page