-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SSH key exchange error when using netconf-console2 (py tool) login #1701
Comments
By default, the server uses an RSA host key, which the client does not support (only the most basic non-secure RSA version). Either change netopeer2 configuration to use an ECDSA host key or change your client configuration to accept the serevr host key algorithm, there is no other solution. |
Thank you for your repIy.
|
You can explicitly set supported host key algorithms in the YANG configuration, the nodes (printed by
The algorithms are defined in iana-ssh-public-key-algs. But it is strange that you have only 2 algorithms enabled, which is definitely not the default configuration, so probably the |
Server Env: netopeer2 (v2.2.8) + libyang (v3.1.0) + libnetconf2 (v3.3.3) + sysrepo (v2.10.1) + libssh (0.10.6)
Client Env: netconf-console2 (v3.0.0) + ncclient (v0.6.7) + paramiko (v2.6.0)
By the /usr/local/bin/netopeer2-cli, account (admin/welcome) login ok. But use netconf-console2 login failed, netopeer2-server log has the following error info , and the same netconf-console2 is working on old netopeer2 (v2.1.36) + libnetconf2 (v2.1.18) .
Why and How to modify code to make netconf-console2 working. Looking forward to your reply, thanks.
Error log of netconf-console2:
$ netconf-console2 --host=172.16.166.228 --user=admin --password=welcome --port=830 get-oc-platform-all.xml
Exception: Incompatible ssh peer (no acceptable host key)
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/paramiko/transport.py", line 2127, in run
self._handler_tableptype
File "/usr/lib/python3/dist-packages/paramiko/transport.py", line 2242, in _negotiate_keys
self._parse_kex_init(m)
File "/usr/lib/python3/dist-packages/paramiko/transport.py", line 2482, in _parse_kex_init
raise SSHException(
paramiko.ssh_exception.SSHException: Incompatible ssh peer (no acceptable host key)
Error log of netopeer2-server ( using -d -v 2)
[INF]: LN: Accepted a connection on 0.0.0.0:830 from 172.16.161.114:36360.
[2021/01/06 02:19:09.253695, 1] ssh_kex_select_methods: kex error : no match for method server host key algo: server [rsa-sha2-512,rsa-sha2-256], client [ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-rsa,ssh-dss]
[ERR]: LN: SSH key exchange error (kex error : no match for method server host key algo: server [rsa-sha2-512,rsa-sha2-256], client [ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-rsa,ssh-dss]).
Some other info:
//login ok
sh-5.2# /usr/local/bin/netopeer2-cli
load_config: No saved configuration.
// Netconf key configuration:
ietf-keystore-startup.xml is generated from merge_hostkey.sh script
ietf-netconf-server-startup.xml refer to ietf-netconf-server-startup.xml.txt
The text was updated successfully, but these errors were encountered: