Cisco-SAN / mdssdk

Python SDK/API library for Cisco MDS Switches
Other
5 stars 15 forks source link

Can this be made to authenticate via ssh_key file? #9

Closed wardy3 closed 3 years ago

wardy3 commented 3 years ago

netmiko appears to support this via CiscoSSHConnection

but mdssdk classes (eg Switch) don't have it in their init

I think this just needs to be passed down to the SSHSession.init._cisco_device dict, as its _connect method passes all the items to netmiko's ConnectHandler, yeah?

thanks!

srbharadwaj commented 3 years ago

@wardy3 if netmiko supports this then i think mdssdk can also support it as it just leverages netmiko, let me see how well can i integrate it into mdssdk switch class

wardy3 commented 3 years ago

@wardy3 if netmiko supports this then i think mdssdk can also support it as it just leverages netmiko, let me see how well can i integrate it into mdssdk switch class

hi. any progress on this? i'm planning on using this module in anger and i need to be able to authenticate passwordless

thanks!

srbharadwaj commented 3 years ago

Hi, sorry was not able to look into this as there were other priority issues, can you raise a PR if you know how this works?

wardy3 commented 3 years ago

Thanks Suhas

I don’t but if I get it working, I will

Thanks ☺

From: Suhas Bharadwaj @.> Date: Monday, 23 August 2021 at 14:47 To: Cisco-SAN/mdssdk @.> Cc: Wardy @.>, Mention @.> Subject: Re: [Cisco-SAN/mdssdk] Can this be made to authenticate via ssh_key file? (#9)

Hi, sorry was not able to look into this as there were other priority issues, can you raise a PR if you know how this works?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/Cisco-SAN/mdssdk/issues/9#issuecomment-903439614, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADSPYPWIABBOIITLLKPYP2DT6HHG5ANCNFSM4246P37Q.

wardy3 commented 3 years ago

Hi, sorry was not able to look into this as there were other priority issues, can you raise a PR if you know how this works?

ok, wasn't too hard. but i'm not sure how you want to set up the tests for it. Looks like you have a test switch and a hard-coded password?

srbharadwaj commented 3 years ago

Hi, sorry was not able to look into this as there were other priority issues, can you raise a PR if you know how this works?

ok, wasn't too hard. but i'm not sure how you want to set up the tests for it. Looks like you have a test switch and a hard-coded password?

Looked at the code, ya it looks like a simple change. You can add a unit test case here https://github.com/Cisco-SAN/mdssdk/tree/master/tests/test_switch/ Or send me a sample script on to use this feature, i can figure out adding a unit test case

srbharadwaj commented 3 years ago

Can pick the code from here and see if key_file is working as expected? https://github.com/srbharadwaj/mdssdk?organization=srbharadwaj&organization=srbharadwaj