Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > ssh problem using paramiko?

Reply
Thread Tools

ssh problem using paramiko?

 
 
sa6113
Guest
Posts: n/a
 
      10-07-2008

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
error10061 ,'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-us...p19857268.html
Sent from the Python - python-list mailing list archive at Nabble.com.

 
Reply With Quote
 
 
 
 
Johny
Guest
Posts: n/a
 
      10-07-2008
On Oct 7, 2:40 pm, sa6113 <(E-Mail Removed)> 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
> error10061 ,'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-us...57268p19857268...
> 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()



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
net/ssh in ruby. ssh.exec fails salamond Ruby 0 02-17-2011 03:16 AM
NET:SSH fails authentification with :keys - ssh works Tench Johnson Ruby 1 04-23-2010 12:11 AM
python ssh and Tetia SSH server loial Python 0 02-10-2009 01:06 PM
Python ssh with SSH Tectia server loial Python 0 02-03-2009 03:38 PM
SSH Module: Accessing CLI box using SSH and not getting the return output?? Deepika Perl Misc 2 11-14-2006 04:48 AM



Advertisments