Questions tagged [libssh]

libssh is a mulitplatform C library implementing the SSHv2 and SSHv1 protocol on client and server side.

libssh is a C library that enables you to write a program that uses the SSH protocol. With it, you can remotely execute programs, transfer files, or use a secure and transparent tunnel for your remote programs. The SSH protocol is encrypted, ensures data integrity, and provides strong means of authenticating both the server and the client. The library hides a lot of technical details from the SSH protocol, but this does not mean that you should not try to know about and understand these details.

libssh is a Free Software / Open Source project. The libssh library is distributed under LGPL license. The libssh project has nothing to do with "libssh2", which is a completely different and independent project.

libssh can run on top of either libgcrypt or libcrypto, two general-purpose cryptographic libraries.

196 questions
10
votes
4 answers

How to use libssh in VS10

How can I implement libssh as a library my compiler will recognize? I'm using Visual Studio 2010 C++, and I've included the Boost library with no problems, but the process I did with Boost is strange, I can tell libssh will be different. I really…
Saustin
  • 1,077
  • 6
  • 14
  • 27
10
votes
1 answer

Send channel request from SSH server making `ssh_channel_accept_forward()` return on SSH client?

I use the client code for direct and reverse port forwarding from the official tutorials: http://api.libssh.org/master/libssh_tutor_forwarding.html This code works perfectly when connecting the client to an OpenSSH server on Ubuntu 16.10, i.e.,…
Shuzheng
  • 7,974
  • 8
  • 48
  • 112
10
votes
3 answers

How to copy a file in C/C++ with libssh and SFTP

I want to copy a file from a client to a remote server, but I don't understand how to do it with the libssh library SFTP API. The situation is that: The SSH session is open and the SFTP session is open too, I can create a file and write in it from…
Raphael Teubner
  • 676
  • 3
  • 9
  • 19
9
votes
2 answers

How to establish a simple ssh connection with c++

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 can not. In my code I am using the library libssh.h and for development I…
mac johnsto
  • 113
  • 1
  • 1
  • 7
5
votes
3 answers

what is the major difference libssh vs libssh2?

I googled "libbssh vs libssh2" , couldn't find good explanation about the difference between of them. What is the major difference ? The main functionality that i need is copying files , which of the lib is recommended ?
LIOR
  • 91
  • 1
  • 8
5
votes
2 answers

CMake Warning (dev) in CMakeLists.txt: No cmake_minimum_required command is present. A line of code such as cmake_minimum_required(VERSION 3.9)

I'm trying to build ssh.lib from source using cmake. For this purpose I have downloaded the libssh 0.8.2, Win32OpenSSL_Light-1_1_0i and cmake-3.9.0-rc1-win64-x64. Visual Studio 2017 is used. I have installed open SSL into c directory then I use…
user10330249
5
votes
1 answer

SSH local port forwarding using libssh

Problem I try to do local port forwarding using libssh with the libssh-C++-wrapper. My intention is to forward port localhost:3306 on a server to localhost:3307 on my machine via SSH to connect via MySQL to localhost:3307. void…
dtell
  • 2,231
  • 1
  • 10
  • 29
5
votes
1 answer

ERROR Compiled without LIBSSH v0.4.x support, module is not available

I'd like to toy with hydra on my OSX, but I can't figure out what's the problem. brew info hydra output: hydra: stable 8.3 (bottled), HEAD Network logon cracker which supports many services https://www.thc.org/thc-hydra/ /usr/local/Cellar/hydra/8.3…
user3187548
  • 61
  • 1
  • 6
5
votes
1 answer

libssh: Memory lost in simple implementation

I am trying a very simple implementation of libssh but valgrind shows memory leak. The code is: #include #include #include #include #include int main() { ssh_session my_ssh_session…
Rohit
  • 584
  • 1
  • 8
  • 24
4
votes
4 answers

is it better to use sleep() or an infinite loop to wait for an event?

I'm currently working on a client that talk with a SSH server. Everything works well, but, because the server is quite slow to answer, I have to wait for it to send data. I have two choices, and I'd like to have your advice about what is the most…
Chouchenn
  • 43
  • 8
4
votes
0 answers

How can I open one channel and than execute several different commands in libssh?

For example i want to open one session and one channel and then execute severeal different commands. I have InitializeSSHSession and Initialize SSH channel methods can be seen below. void Computer::InitializeSSHSession() { ssh_session…
EmreS
  • 143
  • 2
  • 13
4
votes
2 answers

Does libssh supports sftp server functionality?

In my project i need to transfer files between a server and multiple clients. The communication between client and server should be encrypted, there should be an authentication by username and password and the protocol should be a common one, so i…
user2369952
  • 53
  • 2
  • 4
3
votes
0 answers

How to give Timeout time to SSH_SCP APIs (libssh) in C++

In my current project. I am working on ssh_scp APIs (more precisely ssh_scp_push_file, ssh_scp_write, ssh_scp_push_directory APIs). Here is the code snipet for it. rc = ssh_scp_push_file(scp, file_name, size, S_IRUSR | S_IWUSR); if (rc != SSH_OK) { …
Yash Katta
  • 31
  • 2
3
votes
1 answer

link libssh with static library (libssh.a)

I was trying to link my program with libssh static library. Following is my simple code copied from libssh tutorial: //sshtest.c #define LIBSSH_STATIC 1 #include #include int main() { ssh_session my_ssh_session; …
NoobieG
  • 53
  • 5
3
votes
1 answer

libssh - send request multiple times and read answer from channel

I have created one session and one channel. A request (ssh_channel_request_exec) is supposed to be sent about every second and I want to read the answer (ssh_channel_read) to this request. However, I could not find an example on how to make multiple…
Ires Mari
  • 49
  • 7
1
2 3
13 14