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

authentication failed error occured while using paramiko

5
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
0 2501

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

Similar topics

7
by: Michael Foord | last post by:
#!/usr/bin/python -u # 15-09-04 # v1.0.0 # auth_example.py # A simple script manually demonstrating basic authentication. # Copyright Michael Foord # Free to use, modify and relicense. #...
6
by: Erez Shor | last post by:
Hi, I need to build and asp page which access a remote windows server's registry and create a registry key. In order for the ASP page to be able to access the registry on the remote server I need...
1
by: Thomas Scheiderich | last post by:
I am having a problem connecting to an Sql Server using Windows Authentication. I am using the following command: server=Raptor;uid=tfs;password=tol1ee;database=ABC;Network Library =dbmssocn ...
2
by: Steve M | last post by:
A few users today received the message "The trust relationship between this workstation and the primary domain failed" on their web browser while using an ASP.NET web app. The problem went away...
8
by: Nils Magnus Englund | last post by:
Hello, I am having trouble using Integrated Windows Authentication between our intranet server and our database server, both of which are on our local domain. Windows authentication works for...
2
by: rcp | last post by:
Hi all, I've read all posts from all existing threads and none of them worked to solve my problem, although its exactly the same. I'll try to explain my case and see if a kind soul could help me...
0
by: Benjamin Gufler | last post by:
Hello NG, I'm experiencing problems in configuring DB2 v9.1 on Linux (RedHat AS4) to use Kerberos authentication against an AD (W2K3 R2). IBM Network Authentication Service is installed and...
4
by: webrod | last post by:
Hi, I am trying to secure a WS using WSE 3.0 and kerberos. I used the "WSE 3.0 settings" from VS2005 with my own WS. I have a console application which try to access a WS. With the...
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: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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...

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.