467,104 Members | 1,089 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,104 developers. It's quick & easy.

ssh problem using paramiko?


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

Oct 7 '08 #1
  • viewed: 3433
Share:
1 Reply
On Oct 7, 2:40 pm, sa6113 <s.payan...@gmail.comwrote:
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-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()

Oct 7 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by hanjar | last post: by
2 posts views Thread by eight02645999@yahoo.com | last post: by
reply views Thread by washakie | last post: by
1 post views Thread by Terry Reedy | last post: by
4 posts views Thread by sa6113 | last post: by
reply views Thread by sa6113 | last post: by
reply views Thread by sa6113 | last post: by
reply views Thread by sa6113 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.