libssh icon indicating copy to clipboard operation
libssh copied to clipboard

libssh 0.8.0 update with libssh 0.10.5 (latest)

Open GillesPelletierFr opened this issue 2 years ago • 0 comments

Hello, I have an old project started in 2018, using libssh 0.8.0 and still working. It's a kind of tutorial trying to connect like telnet does, but with ssh and port 22. I try to update it by using libssh 0.10.5 (the latest), but I got surprising issues. terminal_libssh_trace.log Terminal.cpp.log

Context

The source code is in Terminal.cpp.log (remove .log, you got the cpp)

Expected Behavior

Should works like the 0.8.0 version.

It outputs that: Host: xxx Login: xxx Password: xxx Session... Connecting... Password Autentication... Channel... Opening... Info libssh version "0.7.90/gnutls/zlib" Info SSH 2 Info OpenSSH version 0x00080000 Info Server banner"SSH-2.0-OpenSSH_8.0" Info Banner "(null)" Info Key exchange algo. "curve25519-sha256" Info Cipher in "aes256-ctr" Info Cipher out "aes256-ctr" Info HMAC in "hmac-sha2-256" Info HMAC out "hmac-sha2-256"

xxx

Last login: Wed Nov 22 11:40:04 2023 from xxx %

got the login !

Actual Behavior

ssh_connect() returns -1

Host: xxx Login: xxx Password: xxx Session... Connecting... Error: Failed to verify server hostkey signature Press a key...

Steps to Reproduce

  1. linux server with a sshd (like redhat 8)
  2. include the libssh.lib in the properties manager of the Visual Studio 2022
  3. compile the Terminal.cpp as a console project with Visual Studio 2022
  4. launch it in debug, and input the server name, login and password.

Your Environment

  • Version Used: libssh.lib x86 from libssh_libssh-0.10.5_msvc17.zip
  • Operating System and Version: Windows 10
  • Compiler and Version(s): Visual Studio 2022

Possible Fix

The logs show something around the known_hosts file, that it doesn't care in the 0.8.0 version.

A working tutorial, or a workaround is welcome. Thanks. .

GillesPelletierFr avatar Nov 22 '23 15:11 GillesPelletierFr