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
1
vote
1 answer

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 = sftp_open(sftp, "/home/ra/Desktop/sami/s.txt",…
user10330249
1
vote
0 answers

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 device (which I can) and then run a command once…
Corleone
  • 25
  • 6
1
vote
1 answer

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? I installed libssh-dev from the default repository…
1
vote
1 answer

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 what I am doing wrong! I have been following the API…
marko
  • 327
  • 2
  • 12
1
vote
0 answers

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 to SSH from that host to the server: [PC] -- ssh…
Simo Elmou
  • 35
  • 1
  • 2
  • 9
1
vote
1 answer

Struggling with libssh on Windows

The problem I'm trying to build a project in Visual Studio 2015 on Win10 that makes use of libssh, but I'm having no luck getting it to work. I feel like I'm losing my mind here. I'm either completely blanking out or missing something incredibly…
fny82
  • 185
  • 3
  • 13
1
vote
1 answer

Connect to SUSE using libssh

I am trying to establish a connection using libssh(https://www.libssh.org/) to a machine with SUSE Enterprise operating system installed. ssh_options_set(tempSshSession, SSH_OPTIONS_HOST, host2Connect); ssh_options_set(tempSshSession,…
1
vote
2 answers

libssh2 and C++

When I try to use libssh2 in my C++ class, I keep getting the following errors: undefined reference to `libssh2_session_init_ex' undefined reference to `libssh2_session_startup' If I do the same thing using C, everything works fine. Any…
Avinash
  • 12,851
  • 32
  • 116
  • 186
1
vote
1 answer

Compile libssh with msvc for x64

First of all, I’m not an expert in build libraries from the source with cmake and all this stuff. But unfortunately I have to. I followed up the steps mention in the INSTALL document of the libssh and read a few archived mails but nothing helps me…
sandkasten
  • 603
  • 1
  • 8
  • 21
1
vote
1 answer

What is the difference between requesting a shell separately or through PTY in SSH protocol?

What is the difference between requesting a shell separately or through PTY in SSH protocol? I want to program a remote shell application using libssh. To do this, I've the options between requesting a shell or requesting a shell through PTY. The…
Shuzheng
  • 11,288
  • 20
  • 88
  • 186
1
vote
0 answers

Compiling libssh for QNX (BB10)

I'm trying to use libssh in my BlackBerry 10 project and have no idea how to compile it for this platform. Could you provide some steps to achieve this?
Alexander Doloz
  • 4,078
  • 1
  • 20
  • 36
1
vote
0 answers

Channel in libssh gets closed for no obvious reason

I am building a small library which uses libssh to log into a remote host, and fire some commands on a remote shell. I am basically following the tutorial, in that I connect the session, verify the host & user, then open a channel, and request a…
user826955
  • 3,137
  • 2
  • 30
  • 71
1
vote
1 answer

Send File via libssh (ssh_scp_push_file && ssh_scp_write)

Disclaimer: I'm googling my way through this Using C++ Both ends are Linux I can see the SSH connection on the far end via TCPDUMP No build errors or return codes other than 0 (debug says its all good) TCPDUMP doesn't look like its transferring…
Snow
  • 41
  • 8
1
vote
1 answer

Compile libssh for ESP32

I am trying to use the libssh library on the ESP32. When I compile the program, I get lots of errors. The first error is "fatal error: sys/select.h: No such file or directory." I commented it out just to see if I could get past it, and it says it…
user3735849
  • 893
  • 1
  • 6
  • 6
1
vote
1 answer

How can I configure wordpress to run auto updates from admin when my server is running php7

It seems that the php ssh2 / libssh2 is not available in php7 so easily. I am trying to install it and just cant find any information online. If I run this: sudo apt-get install libssh2–1-dev libssh2–1 I get these errors: E: Unable to locate…
user3200080
  • 135
  • 1
  • 2
  • 9