467,092 Members | 1,279 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

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

authentication failed error occured while using paramiko

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 it necessery ? or may I have to install another program?

2- I have entered server's Ip insted of hostname.Is it correct?

3- I have creat a user in server machine with a password to connect. Am I right?

4- I use this code in clinet computer? May I need another code for server computer?
Expand|Select|Wrap|Line Numbers
  1. hostname = "192.168.1.4" 
  2. username = "test" 
  3. port = 22 
  4. password = '123456' 
  5.  
  6. # now connect 
  7. try: 
  8.     sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 
  9.     sock.connect_ex((hostname, port)) 
  10. except Exception, e: 
  11.     print 'Connect failed: ' + str(e) 
  12.     traceback.print_exc() 
  13.     sys.exit(1) 
  14.  
  15. t = paramiko.Transport(sock) 
  16. event = threading.Event() 
  17. t.start_client(event) 
  18. print "started client" 
  19. event.wait(15) 
  20.  
  21. if not t.is_active(): 
  22.     print 'SSH negotiation failed.' 
  23.     sys.exit(1) 
  24. else: 
  25.     print "SSH negotiation sucessful" 
  26.  
  27. print "doing authentication" 
  28. t.auth_password(username, password, event) 
  29.  
  30.  
  31. event.clear() 
  32. event.wait(20) 
  33.  
the result is :
started client
ssh negotiation sucessful
authentication failed

what should I do?
please help me , I am new in paramiko.
Oct 27 '08 #1
  • viewed: 2124
Share:

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

7 posts views Thread by Michael Foord | last post: by
1 post views Thread by Thomas Scheiderich | last post: by
8 posts views Thread by Nils Magnus Englund | last post: by
reply views Thread by Benjamin Gufler | last post: by
4 posts views Thread by webrod | 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.