Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Paramiko/SSH blues....

Reply
Thread Tools

Paramiko/SSH blues....

 
 
Tarun Kapoor
Guest
Posts: n/a
 
      01-16-2008
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

 
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




Advertisments