I am using ncclient to connect to the netconf. However when ever i try to connect through python
"ncclient.transport.errors.SessionCloseError: Unexpected session close" error is thrown. the code snippet that i am using is given below
manager.connect('<servername>',22,username='<username>')
Any help on this is much appriciated. I am able to connect to the remote server by using public key, hence i didnt provide passwordk in connect
And in the netconf server logs i am able to see access-denied error. (I got the same prob even when i tried with username and pwd)
You haven't given a lot of information.
ncclientare you using?libnetconforyuma?Based on the info here, I could imagine a couple of things being wrong:
paramikoisn't using the right key to establish SSH transport.In your script, create some logs with something like
manager.logging.basicConfig(filename='ncclient.log', level=manager.logging.DEBUG)and then re-run your script - do you get anything more informative?This is an old question, but I hope I can point you in the right direction at least.