ssh problem using paramiko?

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

  1. sa6113

    sa6113 Guest

    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)

    ------------------
    and I got this error :
    sock.connect((hostname, port))
    File "<string>", line 1 , in connect
    error:(10061 ,'Connection refused')
    -------------------
    what is the problem?
    I have a computer with this Ip and username , password in my network.
    Do I have to install ssh or somthing else in that computer(server) or run
    any script?


    --
    View this message in context: http://www.nabble.com/ssh-problem-using-paramiko--tp19857268p19857268.html
    Sent from the Python - python-list mailing list archive at Nabble.com.
    sa6113, Oct 7, 2008
    #1
    1. Advertising

  2. sa6113

    Johny Guest

    On Oct 7, 2:40 pm, sa6113 <> wrote:
    > 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)
    >
    > ------------------
    > and I got this error :
    > sock.connect((hostname, port))
    > File "<string>", line 1 , in connect
    > error:(10061 ,'Connection refused')
    > -------------------
    > what is the problem?
    > I have a computer with this Ip and username , password in my network.
    > Do I have to install ssh or somthing else in that computer(server) or run
    > any script?
    >
    > --
    > View this message in context:http://www.nabble.com/ssh-problem-using-paramiko--tp19857268p19857268...
    > Sent from the Python - python-list mailing list archive at Nabble.com.


    Why do not use only Paramiko

    import paramiko

    t = paramiko.Transport((Myserver, 22))
    t.start_client()
    t.auth_password(Login,'Password)

    chan = t.open_session()
    Johny, Oct 7, 2008
    #2
    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. Tarun Kapoor

    Paramiko/SSH blues....

    Tarun Kapoor, Jan 16, 2008, in forum: Python
    Replies:
    0
    Views:
    325
    Tarun Kapoor
    Jan 16, 2008
  2. DHR
    Replies:
    8
    Views:
    1,014
    Charles_hans
    Jan 30, 2008
  3. washakie
    Replies:
    0
    Views:
    635
    washakie
    Jan 30, 2008
  4. sa6113

    Re: ssh problem using paramiko?

    sa6113, Oct 8, 2008, in forum: Python
    Replies:
    4
    Views:
    371
    Steve Holden
    Oct 9, 2008
  5. Deepika
    Replies:
    2
    Views:
    200
    Deepika
    Nov 14, 2006
Loading...

Share This Page