CESNET / netopeer2

NETCONF toolset
BSD 3-Clause "New" or "Revised" License
300 stars 188 forks source link

Doubts in Netopeer2-cli Listen command #1577

Open Omnamasivaya26 opened 4 months ago

Omnamasivaya26 commented 4 months ago

when I used to put Listen --login tester ,the connection was not established but i can able to connect using normal connect command . I'm unable to figure out the issue but there is no issues with connectivity,firewall and port . So need help in sorting out this issue!

tester@tester-pc:~$ netopeer2-cli load_config: No saved configuration.

listen --login tester Waiting 60s for an SSH Call Home connection on port 4334... cmd_listen: Receiving SSH Call Home on port 4334 as user "tester" timeout elapsed.

this is the respective log captured during the process ,

May 16 12:17:54 netopeer2-server[1412]: Accepted a connection on 0.0.0.0:830 from 127.0.0.1:35834. May 16 12:17:54 netopeer2-server[1412]: [INF]: LN: Accepted a connection on 0.0.0.0:830 from 127.0.0.1:35834. May 16 12:17:54 netopeer2-server[1412]: [INF]: SR: Session 41 (user "tester", CID 1) created. May 16 12:17:54 netopeer2-server[1412]: Session 41 (user "tester", CID 1) created. May 16 12:17:54 netopeer2-server[1412]: [2024/05/16 12:17:54.300724, 1] ssh_server_connection_callback: SSH client banner: SSH-2.0-libssh_0.8.6 May 16 12:17:54 netopeer2-server[1412]: [2024/05/16 12:17:54.300769, 1] ssh_analyze_banner: Analyzing banner: SSH-2.0-libssh_0.8.6 May 16 12:17:54 netopeer2-server[1412]: [2024/05/16 12:17:54.335059, 1] ssh_packet_socket_callback: read_packet(): Packet len too high(1180448200 465c35c8) May 16 12:17:54 netopeer2-server[1412]: [ERR]: LN: SSH key exchange error (read_packet(): Packet len too high(1180448200 465c35c8)). May 16 12:17:54 netopeer2-server[1412]: SSH key exchange error (read_packet(): Packet len too high(1180448200 465c35c8)).

michalvasko commented 4 months ago

Nothing I can help with, obviously a libssh issue. And you must be using an old libnetconf2 version if you could compile it with libssh 0.8.6, currently the oldest supported version is 0.9.5 so if you updated it, it should work.

Omnamasivaya26 commented 4 months ago

Thanks Michal but the issue is I'm unable to install the latest libssh due to compiling issue regarding openssl fips . I have checked with latest openssl 3 version and also along with it I have installed the fips module (openssl-fips-2.0.16) but still I'm encountering the issue in compiling libssh,

/home/tester/netopeer/latest_netopeer2/libssh-0.9.5/src/kex.c: In function ‘ssh_client_select_hostkeys’: /home/tester/netopeer/latest_netopeer2/libssh-0.9.5/include/libssh/libcrypto.h:116:26: error: implicit declaration of function ‘FIPS_mode’ [-Werror=implicit-function-declaration] 116 | #define ssh_fips_mode() (FIPS_mode() != 0) | ^~~~~ /home/tester/netopeer/latest_netopeer2/libssh-0.9.5/src/kex.c:583:13: note: in expansion of macro ‘ssh_fips_mode’ 583 | if (ssh_fips_mode()) { | ^~~~~ cc1: some warnings being treated as errors make[2]: [src/CMakeFiles/ssh.dir/build.make:300: src/CMakeFiles/ssh.dir/kex.c.o] Error 1 make[1]: [CMakeFiles/Makefile2:399: src/CMakeFiles/ssh.dir/all] Error 2

openssl version OpenSSL 3.0.0 7 sep 2021 (Library: OpenSSL 3.0.0 7 sep 2021) built on: Thu May 16 09:17:45 2024 UTC platform: linux-x86_64 options: bn(64,64) compiler: gcc -fPIC -pthread -m64 -Wa,--noexecstack -Wall -O3 -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_PIC -DOPENSSL_BUILDING_OPENSSL -DNDEBUG OPENSSLDIR: "/usr/local/ssl" ENGINESDIR: "/usr/local/lib64/engines-3" MODULESDIR: "/usr/local/lib64/ossl-modules" Seeding source: os-specific CPUINFO: OPENSSL_ia32cap=0x7ffaf3bfffebffff:0x18c05fdef3bfa7eb

michalvasko commented 4 months ago

Ask libssh for support, I really cannot help you with this. However, it seems you have a rather constrained environment and we have recently added support for compiling libnetconf2 with MbedTLS, libssh can be compiled with that as well, so maybe you do not want to use OpenSSL. But if you do, I would try using a newer version than 3.0.0, not sure why you have not picked the latest libssh and OpenSSL versions.