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.

218 questions
0
votes
1 answer

how to get output of a wrong command with libssh

I have this function which can connect to a remote system via ssh: std::string _ErrMsg; int _RetVal = 0; MyException errMsg; int port = 22; try { if (my_ssh_session == NULL) { std::cout << "Error…
fa7eme
  • 73
  • 10
0
votes
1 answer

memory leak while using ssh_channel_open_session in an array

I have this function which executes a command through a ssh channel: std::string ssh::exec_ssh_command(const char* command) { std::string receive = ""; std::string err; int rc, nbytes; char buffer[2000]; MyException errMsg; …
fa7eme
  • 73
  • 10
0
votes
0 answers

Where can I get libssh for windows without vcpkg?

I am trying to get ssh library from here but i am using Eclipse as IDE and i am not able to use vcpkg. Can anyone help me with some information.
Ionut Alexandru
  • 680
  • 5
  • 17
0
votes
1 answer

how to use a shared library which includes another shared library in c++

I have a c++ program, which contains two classes. one of them is using libssh and some of its functions and another one is for calculating cpu usage. there is a link of how I a built and added libssh:libssh's functions couldn't be found on qt my…
fa7eme
  • 73
  • 10
0
votes
0 answers

ssh_channel_read_nonblocking( ) just echoback the given command?

I am trying to implement an ssh client using libssh but output seems to just be an echo of whatever been sent main part of program is : do { printf("Enter Command or q to exit: "); fgets(command, 100, stdin); …
KMG
  • 1,433
  • 1
  • 8
  • 19
0
votes
1 answer

reading from ssh channel and writing to a buffer

I have this function which if you connect to a system with ssh, you can call it to execute your given command on that system. std::string sshconnection::exec_ssh_command(ssh_session session, char *command) { string receive = ""; int rc,…
fa7eme
  • 73
  • 10
0
votes
1 answer

Linking libssh statically for MinGW

I am trying to statically link libssh to my project which is built using a mingw/mysys makefile, however no matter what I try I get a whole bunch of undefined reference errors. I've spent hours researching this but I still can't fix it. Below is my…
Owen Kuhn
  • 85
  • 6
0
votes
1 answer

config.h: No such file or directory in ssh_client from libssh's example

When I compile ssh_client code from example folder of libssh source directory( I have wrote about building process of this library in this link : libssh's functions couldn't be found on qt): #include "config.h" #include #include…
fa7eme
  • 73
  • 10
0
votes
0 answers

libssh's functions couldn't be found on qt

I have cloned libssh library and built it with cmake. Building process was like this : git clone https://git.libssh.org/projects/libssh.git/ mkdir build in libssh directory. cd build cmake -DUNIT_TESTING=ON -DCMAKE_INSTALL_PREFIX=/usr…
fa7eme
  • 73
  • 10
0
votes
0 answers

Visual Studio Building static lib gets unresolved external symbol

I am statically building LibSSH on Windows and managed to build it with cmake-gui. If I build the resulting Visual Studio project, I get the ssh.lib file. However, if I link this .lib file to another project where I need it, I receive following…
qweqwe
  • 33
  • 6
0
votes
0 answers

Reading files present in a directory in a remote folder through SFTP

TLDR; Convert the bash line to download sftp files get Inbox/* to c++ or python. We do not have execute permissions on Inbox directory. I am trying to read the files present in a directory in a remote server through SFTP. The catch is that I only…
anon
  • 1,258
  • 10
  • 17
0
votes
0 answers

How libssh2 read and write functions works

I'm not sure if i'm allowed to ask this type of questions here but i hope i'm not violent any rules. lately i'm reading about SSH and trying to start some basic programs about sending ssh commends to an SSH remote device (my device i a raspberry pi)…
shadow
  • 767
  • 3
  • 8
  • 20
0
votes
0 answers

Some Error Happening when Simulating Attack against libssh

when I was simulating ssh attack for the bug CVE-2018-10933. I met the following error: the output I encountered. It seemed that there is some error in the exce_command function. Any help would be appreciated. My paramiko version is 2.0.8; I have…
0
votes
0 answers

Copy a jpg and h264 file from remote server to windows using sshlib scp function

I need to download a directory from a remote location by using libssh and scp protocol. The directory contaains audio, video and some text files in it. Using the below code, I am trying to scp these files from a directory with the help of libssh scp…
CodeHunter
  • 2,017
  • 2
  • 21
  • 47
0
votes
0 answers

libssh tunnel echoing input

I've created my own SSH reverse tunnel using libssh by following the tutorials at http://api.libssh.org/master/libssh_tutorial.html and piecing things together from various other samples. However, now, all I get is the client echoing back whatever…
Godzilla74
  • 2,358
  • 1
  • 31
  • 67