473,695 Members | 2,317 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

authentication failed error occured while using paramiko

5 New Member
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 2535

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

Similar topics

7
9285
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. # No warranty express or implied for the accuracy, fitness to purpose
6
2396
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 it to run using credentials supplied by the user. When using basic authentication this is not an issue since the user has to provide a user name and password. But I don't want to use basic authentication so I created a login form and I am using...
1
1743
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 This works fine if Sql Server is set up as Sql and Windows Authentication. If I change the Sql Server to Windows Authentication, I get the following page:
2
14940
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 but has anyone seen this before on a error page? I think it occured when users were reporting general slow web performance. I've seen it while users try to log into an NT domain from their desktops but not while using a web browser. Users can log...
8
3426
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 our intranet server - my domain user "DOM\nme" is correctly authenticated and authorized to view the ASP.NET page on our intranet. The ASP.NET application uses impersonation (<identity impersonate="true"> in Web.config).
2
11427
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 out: I've a win32 service in C# on a client machine A, which accesses a WS (C#) on a server machine B (hosted on an IIS) Case 1: If I try to add the WSDL for the WS through VS2005, the 'Discovery
0
2944
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 configured following the instructions on http://www-128.ibm.com/developerworks/db2/library/techarticle/dm-0603see/index.html /etc/krb5/krb5.keytab contains a key for the instance owner, according to klist -k:
4
7385
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 following configuration it works: - WS/IIS and AD on the Windows 2003 server - console application on a Windows XP workstation
0
2179
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) event = threading.Event() t.start_client(event) event.wait() if not t.is_active(): print 'SSH negotiation failed.'
0
8635
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8574
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9116
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
7664
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6493
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5839
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4580
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2276
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1977
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.