Questions tagged [libssh]

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

libssh
Filter by
Sorted by
Tagged with
0 votes
0 answers
434 views

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's user avatar
0 votes
1 answer
1k views

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:...
fa7eme's user avatar
  • 73
0 votes
0 answers
419 views

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: "); ...
KMG's user avatar
  • 1,453
0 votes
1 answer
868 views

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 *...
fa7eme's user avatar
  • 73
0 votes
1 answer
803 views

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 ...
Owen Kuhn's user avatar
0 votes
1 answer
1k views

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): #...
fa7eme's user avatar
  • 73
0 votes
0 answers
243 views

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 -...
fa7eme's user avatar
  • 73
1 vote
1 answer
974 views

libssh's functions couldn't be found on qt and cmake error while building libssh

I want to use libssh library in Qt and my os is ubuntu 18.04 . so I cloned the library's file and tried to build it with cmake. I followed the tutorial in INSTALL folder but the building process can't ...
fa7eme's user avatar
  • 73
0 votes
0 answers
262 views

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 ...
qweqwe's user avatar
  • 33
1 vote
0 answers
758 views

Creating reverse tunnel with LibSSH

I have created a simple server and client with following code: Client int main() { ssh_session my_ssh_session; int rc; char* password; my_ssh_session = ssh_new(); if (...
qweqwe's user avatar
  • 33
0 votes
0 answers
275 views

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 ...
anon's user avatar
  • 1,258
3 votes
0 answers
171 views

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, ...
Yash Katta's user avatar
1 vote
0 answers
148 views

Is there a way to use the configuration values from ~/.ssh/config from libssh?

I'm writing a program which needs to execute remote commands, and it would be very convenient to leverage the configurations which are already present on my machine. I.e. in my ~/.ssh/config file, I ...
sak's user avatar
  • 3,006
1 vote
1 answer
333 views

Windows path problems using libssh C++ wrapper

I am having problems with Windows file path separators using the libssh c++ wrapper libsshpp. Suppose I have following code: #define SSH_NO_CPP_EXCEPTIONS #include "libssh/libsshpp.hpp" #include &...
tai's user avatar
  • 498
1 vote
1 answer
486 views

SSH Connection failed : Failed to process system configuration files

I'm trying to make a simple SSH connection between ssh client which is on my notebook's Windows 10 and Ubuntu which is installed on VMWare. I use libssh for ssh support and Qt Creator as IDE. Here is ...
LichHolyKing's user avatar
3 votes
0 answers
524 views

How do I perform port forwarding in C using libssh on Windows

Below is a section of code I wrote with the help of this post here: C: can I forward port for external application with libssh?. pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; /* initialize the ...
heh's user avatar
  • 48
0 votes
0 answers
416 views

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 ...
shadow's user avatar
  • 845
1 vote
1 answer
2k views

C - libssh and sftp - client/server - creating sftp session hangs

I implemented a client/server communication over SSH with libssh. I also want to implement file upload from client to the server now and have been following the doc for it. However, it hangs on the ...
phoebus's user avatar
  • 1,291
0 votes
0 answers
39 views

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 ...
Ruijie Mao's user avatar
11 votes
3 answers
8k views

what is the major difference libssh vs libssh2? [closed]

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 ...
LIOR's user avatar
  • 169
1 vote
2 answers
830 views

How to dynamically allow users in OpenSSH?

I want to be able to block or allow users based on the result of an external script using OpenSSH. I see that libssh has support for callbacks, but after reading the OpenSSH man pages I cannot find ...
Isaiah Taylor's user avatar
2 votes
1 answer
200 views

How to avoid compressing of image, audio and video files downloaded from remote ssh using libssh scp command in c++?

I am trying to download few files stored on a remote machine. Those files can be either text files, image files (of jpeg,jpg form), video or audio files. Text files are downloaded successfully without ...
CodeHunter's user avatar
  • 2,057
0 votes
0 answers
38 views

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

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 ...
CodeHunter's user avatar
  • 2,057
1 vote
1 answer
2k views

Using Cmake to build ssh.dll with Visual Studio 2017

I am a beginner in C++ and I am trying to build ssh.dll on Windows 32bit using Visual Studio 2017 and cmake. I have downloaded the latest version of libssh and tried to build ssh.dll from the source ...
CodeHunter's user avatar
  • 2,057
0 votes
0 answers
189 views

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, ...
Godzilla74's user avatar
  • 2,442
1 vote
1 answer
3k views

How to properly include libssh in C

I am getting an error every time I try to compile my code with gcc on Ubuntu. I installed libssh-dev by typing: sudo apt-get install libssh-dev and it installed just fine (No error messages) The ...
anon's user avatar
  • 23
2 votes
1 answer
2k views

Copying a file with libssh

I am trying to write a simple program (toy example) that copies a file from a remote host to the local machine. It works when I try to copy a txt file, but not for files like mp4. Here is my code, ...
Leta's user avatar
  • 341
0 votes
1 answer
781 views

Trying to execute command on router. C++ & libssh

When I'm trying to run command on server (router) I get [C] Jan 3 05:32:16 ndm: bin::ndmc: invalid option "-c". Most of the code is taken from the documentation. There is the code: #include <...
Ae_Mc's user avatar
  • 160
0 votes
0 answers
1k views

How can I install libssh2?

I need to install a CMS, but this CMS requires the libssh2 library. When I try to install it according to the instructions, I get errors. Here I will give the places with errors: $ sudo tar zxvf ...
Ben_r007's user avatar
0 votes
2 answers
2k views

import libssh library in Visual Studio 2017

I'm currently trying to include the libssh library on Visual Studio 2017. I already downloaded libssh but I don't know exactly what am I supposed to do with cmake. Where should I include files in ...
bgabriel's user avatar
0 votes
1 answer
870 views

Error when installing libssh build with make install

OS and CMake prehistory I'm trying to installlibssh on Debian GNU/Linux 9.5. I have successfully built the libssh source with cmake and put all the content inside build dir that I had created as ...
filipdobro's user avatar
1 vote
1 answer
399 views

malloc issues with parallelization of ssh calls using threads

I'm trying to do multiple ssh connections(using libssh 0.7.5) and parallelizing them using boost::threads. Upon parallelization I observed that of the 20 executions of my executable 3 failed with ...
Abhinav Jain's user avatar
1 vote
1 answer
2k views

Download file from SFTP server with libssh and write it to ofstream by using C++?

I wrote the following code from this. #define MAX_XFER_BUF_SIZE 16384 int main() { char buffer[MAX_XFER_BUF_SIZE]; //..some content access_type = O_RDONLY; sftp_file file = ...
user avatar
0 votes
2 answers
942 views

File returns NULL Value while using sftp_open() for copying file from local to remote using SFTP libssh in C++

I have Connected to the server using SFTP SSH in c++ and i have already copied files from remote to local. Now i'm trying to copy from local to remote, i read about this from this, but its not working....
user avatar
0 votes
1 answer
581 views

Copying a file from a server to client using Libssh: issues with assigning file copy destination path

I want to copy a file from a server to client,i have already connected the server and i can add some content in a particular file in the server. I have gone through this tutorials and this ,hence i ...
user avatar
2 votes
1 answer
2k views

''No such file or directory' after successfull of 'cmake' generating from source for libssh 0.8.2 in c++?

I have libssh 0.8.2 and cmake 3.12.2. The build is done successfully by using generate option in cmake. There is no ssh.lib file generated after this process by cmake, but and some files (ALL_BUILd, ...
user avatar
5 votes
2 answers
26k views

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 ...
user avatar
2 votes
1 answer
3k views

"Kex error : did not find one of algos diffie-hellman-group1-sha1- in list" when connecting with sshlib

I'm implementing SFTP C++ in Windows to transfer some files. I have downloaded and attached all the libraries for this (libssh 0.5.0) by using this . I found some code from this author : Desphilboy....
user avatar
3 votes
1 answer
2k views

libssh server failed to import private RSA host key

While attempting to get a libssh server running in linux, I am getting caught at the Error Listening to socket: Failed to import private RSA host key. I was using two examples as references. https://...
DocSpiegel's user avatar
0 votes
0 answers
1k views

undefined reference to `_imp__ssh_new' for libssh [duplicate]

I am trying to create ssh connection from my windows 10 to ubuntu 16.04 Code: download.cpp #include "libssh.h" #include <stdlib.h> #include <stdio.h> int main() { ssh_session ...
Md Sajid's user avatar
  • 131
0 votes
1 answer
296 views

SSH client in C libssh rewrite in Java jsch

I have a simple SSH client which is written in C (libssh) and I need to rewrite the client in Java (jsch). Here is the C code: #include <libssh/libssh.h> #include <stdlib.h> #include <...
Jan Švanda's user avatar
1 vote
0 answers
300 views

LibSSH: Interacting with a script/bash within a session

I am using libssh APIs for communicating with a device. I am able to login as 'root' and run basic commands like "ls -l". Problem statement: I want to run a script within the file directory of this ...
Corleone's user avatar
5 votes
1 answer
4k views

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 <libssh/libssh.h> #include &...
NoobieG's user avatar
  • 83
1 vote
1 answer
264 views

Can't get code to compile using libssh in Raspbian in spite of following instructions here and elsewhere

I'm hoping someone might have some ideas for me before I pull the rest of my hair out. I'm working with a Raspberry Pi 3 and libssh-dev and having problems getting the code to compile. Any thoughts? ...
David Peterson Harvey's user avatar
1 vote
1 answer
3k views

c++ libssh - ssh_channel_read() keeps returning 0 and ssh_channel_is_open() returns false

This is the first time I am implementing ssh programmatically and I am baffled about why my code does not work -- to be more specific, ssh_channel_read() keeps returning 0 bytes read. I don't know ...
marko's user avatar
  • 327
0 votes
1 answer
637 views

libssh symbols not found error gcc

I am trying to build a simple SSH client from Wil Allsopp's pen testing book. Working on Mac OS High Sierra with gcc-4.2 with libssh installed using Homebrew. The simplest version of the code is: #...
user2759923's user avatar
1 vote
0 answers
337 views

SSH Tunneling with a c library

I am trying to use libssh library to open an SSH tunnel. Basically, I need to reach a server through a tunnel. First, I would need to SSH to the gateway (I have already done this), then I would need ...
Simo Elmou's user avatar
0 votes
1 answer
446 views

Issues wiith libssh cross-compilation for ARM

I am trying to cross compile libssh for ARM on a beaglebone black, following error happens when I run then 'make' command: [ 52%] Linking CXX executable libsshpp_noexcept ../src/libssh.so.4.5.1: ...
rohit's user avatar
  • 21
0 votes
0 answers
519 views

Install libssh fail due to cmake error

So I was trying to install libssh base on instruction from https://github.com/substack/libssh/blob/master/INSTALL Then when I was trying to build using cmake I have run into problems. I have cmake ...
Slyboots90's user avatar
0 votes
0 answers
636 views

compiling stand-alone exe & libssh

I've been struggling to compile stand-alone exe with i686-w64-mingw32-gcc using libssh; #define LIBSSH_STATIC 1 #include <libssh/libssh.h> #include <stdlib.h> #include <stdio.h> #...
Olli's user avatar
  • 65