473,383 Members | 1,859 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

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
1 3842
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: hanjar | last post by:
Hello, I'm using paramiko 0.9 to access one of my home machines and then execute a command. But with the script included below, the command gets executed on the 2nd to 6th go, never on the...
2
by: eight02645999 | last post by:
hi i downloaded paramiko and was trying to create private/pub key pairs from the docs, i use this method to create private key import paramiko k = paramiko.RSAKey.generate(1024)...
0
by: washakie | last post by:
Hello, I'm trying to write a script which will allow me to initiate (spawn?) an SSH reverse tunnel from an internal box (inside a firewall) to an external box, while logged into the external box. ...
1
by: Terry Reedy | last post by:
"Praveena B" <praveena_python@yahoo.comwrote in message news:808793.504.qm@web44809.mail.sp1.yahoo.com... when i used paramiko in python2.5 i got the error below. File "C:\praveena\python...
4
by: sa6113 | last post by:
I couldn't find any good source for download Openssh on the net? Would you please introduce a URL for download that? Steve Holden-5 wrote: -- View this message in context:...
0
by: sa6113 | last post by:
I am using this code to connect to a windows machine using paramiko, I have installed sshd on the machine and it works properly: sock.connect((hostname, port)) t = paramiko.Transport(sock)...
0
by: sa6113 | last post by:
which program I have to install for using paramiko for sftp between a two windows machine in local network?? I have installed freeSSHd for server machine but I got an Authentication failed erro...
0
by: sa6113 | last post by:
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...
0
by: sa6113 | last post by:
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.