Authentication Failed

See original GitHub issue

Hello and thank you for this project. I am attempting to scan a RouterOS device running version 7.1.3 and I am getting an authentication failure from paramiko. The RouterOS logs say expected msg: 50 got: 5. After some good old fashioned BING searches I saw similar issues opened with an Ansible module (see here: https://github.com/ansible/ansible/issues/55042). I tried a few suggestions mentioned in that thread but did not find luck. Regular ssh user@address -p 2223 works as expected.

python3 main.py -i 172.16.254.1 -p 2223 -u jared+cet1024w -ps PASSWORD
Mikrotik ip address: 172.16.254.1

Traceback (most recent call last):
  File "/Users/jared/routeros-scanner/main.py", line 62, in <module>
    main(args)
  File "/Users/jared/routeros-scanner/main.py", line 28, in main
    ssh_client.connect(hostname=args.ip, port=args.port, username=args.userName, password=args.password)
  File "/usr/local/lib/python3.9/site-packages/paramiko/client.py", line 435, in connect
    self._auth(
  File "/usr/local/lib/python3.9/site-packages/paramiko/client.py", line 766, in _auth
    raise saved_exception
  File "/usr/local/lib/python3.9/site-packages/paramiko/client.py", line 753, in _auth
    self._transport.auth_password(username, password)
  File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 1563, in auth_password
    return self.auth_handler.wait_for_response(my_event)
  File "/usr/local/lib/python3.9/site-packages/paramiko/auth_handler.py", line 244, in wait_for_response
    raise e
paramiko.ssh_exception.AuthenticationException: Authentication failed.`

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
benskevcommented, Mar 18, 2022

You need to set the paramiko parameter “look_for_keys” to false.

Change line 29 in main.py to this: ssh_client.connect(hostname=args.ip, port=args.port, username=args.userName, password=args.password, look_for_keys=False)

1reaction
Prisoner2-6-7commented, Mar 22, 2022

You need to set the paramiko parameter “look_for_keys” to false. Change line 29 in main.py to this: ssh_client.connect(hostname=args.ip, port=args.port, username=args.userName, password=args.password, look_for_keys=False)

@organicnz Looks like you forgot to add allow_agent=False parameter in your ssh_client.connect function ssh_client.connect(hostname=args.ip, port=args.port, username=args.userName, password=args.password, look_for_keys=False, allow_agent=False)

Traceback (most recent call last): File "/root/routeros-scanner/main.py", line 62, in <module> main(args) File "/root/routeros-scanner/main.py", line 31, in main res = command.run_ssh(ssh_client) File "/root/routeros-scanner/commands/dns.py", line 16, in run_ssh sus_dns, recommendation = self.check_results_ssh(res, enabled) File "/root/routeros-scanner/commands/dns.py", line 27, in check_results_ssh if int(item['ttl'].partition('s')[0]) > 200000: ValueError: invalid literal for int() with base 10: '1d'

I also have the same problem if you check the log file of mikrotik its clearly being authenticate but there’s something wrong if the routeros-scanner/commands/dns.py

Read more comments on GitHub >

github_iconTop Results From Across the Web

I get a message that says “Authentication failed”
This kind of error happens when your instant messaging service is not allowing you to connect because it does not recognize your username...
Read more >
What does Authentication Failed mean? - Sync
Authentication failed means there is a temporary block due to too many failed attempts. After 30 minutes after the last login attempt, the...
Read more >
"Authentication failed" error when you try to log on to Unified ...
Fixes a problem in which you receive an "Authentication failed" error message when you use the UPN format to log on to a...
Read more >
Authentication Failed - The Error Explained
When attempting to send an email, your email program may report an "Authentication Failed" error message. Authentication is the act of providing a...
Read more >
Authentication Errors Example 1 Example 2
The error message states “Authentication failed! Try again.” You may have locked your account after too many attempts and your account will need...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found