cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
320
Views
0
Helpful
5
Replies

Unable to execute ncclient connection to cisco ios xr router

js726u
Level 1
Level 1

Unable to execute python3 ncclient connection to cisco ios xr router. its working with only look_for_keys=False option .

Need to check without look_for_keys=False

Please do the needful.

Thanks 

Jay

5 Replies 5

@js726u as i understand the always on sandbox (XR and XE) are only set up to use password-based authentication instead of SSH key-based authentication. I think this is what you ask is, for, you want to set look_for_keys=True (default) and use SSH key-based authentication?

 

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

Hi ,

Thank you for your response.

i dont want to change the python script running in Ubuntu machine . how i can run the python script with ncclient connection by with out look_for_keys=False or True to ios xr router.

Please do the needful.

You would need to generate a pair of SSH key pair on your Ubuntu machine, and then copy the public key (id_rsa.pub or equivalent) from your Ubuntu machine to the router. Here is a guide to do this https://www.cisco.com/c/en/us/td/docs/routers/asr9000/software/asr9k-r7-5/system-security/configuration/guide/b-system-security-cg-asr9000-75x/implementing-secure-shell.html
 
Since you've configured SSH key authentication on your Ubuntu machine and the Cisco IOS XR router, you can run your Python script without modifying it. The ncclient connection will use the SSH keys for authentication. When you run your Python script, ncclient will automatically use the SSH keys to authenticate with the router, without requiring you to set look_for_keys=True or look_for_keys=False.

Note: You need to make sure the SSH keys are properly configured and the public key is added to the router's authorized keys list. If you encounter any issues, you can check the SSH logs on your Ubuntu machine and the router to troubleshoot the problem.
 
Hope this helps.
Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

js726u
Level 1
Level 1

hi bigevilbeard

Thank you for your response ! and its helped . In our case , it was issue with ubuntu rsa keys and not with ios xr .After deleted the entire rsa file , we able to connect with ios xr router .
 
Thank you so much for your great support !

No problem @js726u 

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io