Paramiko/SSH blues....

T

Tarun Kapoor

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,999
Messages
2,570,243
Members
46,836
Latest member
login dogas

Latest Threads

Top