473,386 Members | 1,821 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,386 software developers and data experts.

Paramiko/SSH blues....

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

Jan 16 '08 #1
0 1082

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: dmorilha | last post by:
Hello all, I developed a solution using paramiko and a similar Telnetlib class to access a several number of network devices in replacement of using Pexpect library and openssh client. It worked...
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...
2
by: sa6113 | last post by:
I use this code : hostname = "192.168.1.4" username = "test" port = 22 password = '123456' # now connect try: sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
1
by: sa6113 | last post by:
I use this code : import paramiko import socket hostname = "192.168.1.4" username = "test" port = 22 password = ''123456"
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:
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: 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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.