How to establish a simple ssh connection with c++

后端 未结 2 1441
粉色の甜心
粉色の甜心 2021-02-08 22:01

I am trying to make a c++ program which will connect to an ssh server (my laptop). The server is ok because I can get connected via putty. Although the program I wrote so far ca

相关标签:
2条回答
  • 2021-02-08 22:13

    Finally got it! I removed the line

    ssh_options_set(my_ssh_session, SSH_OPTIONS_CIPHERS_C_S,"aes128-ctr");
    

    Then I used the ssh.dll from libssh v0-7.2 instead of the ssh.dll of v0-7.1 I used before. The ssh.dll is located in libssh-0.7.2\bin. If you take an error like the msvcr120d.dll is missing try to change from debug to release in visual studio.

    0 讨论(0)
  • 2021-02-08 22:30

    Try to use different cipher. 3des-cbc is broken and probably disabled on your server already.

    There is really nice tutorial with simple session.

    Removing the line makes it working for me on Ubuntu (don't know where you found it):

    ssh_options_set(my_ssh_session, SSH_OPTIONS_CIPHERS_C_S,"aes128-ctr");
    

    If not, what version of libssh are you using? Isn't it some obsolete one?

    0 讨论(0)
提交回复
热议问题