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

Server with ssh public key authentication with libssh

Can someone give an example with server with ssh public key authentication with libssh? I found this https://github.com/substack/libssh/blob/master/examples/samplesshd-tty.c, but it's authentication with password. May be someone seen example like…
Vlad
  • 1,541
  • 1
  • 21
  • 27
1
vote
0 answers

Can I use libssh with SSH2?

I am trying to use libssh to execute show_remote_files(session) on remote host. But it gets stuck and gives the following output. I used get_ssh_version and it shows 2. Can I not use ssh2 with libshh? How can I tell my system(linux) to use ssh1…
G Gill
  • 1,087
  • 1
  • 12
  • 24
1
vote
3 answers

Install libssh include libsshpp.hpp

I'm writing a C++ program using libssh so I look around to install the library. At first I install by sudo apt-get install libssh-dev but there's no libsshpp.hpp in /usr/include/libssh. Then I clone git://git.libssh.org/projects/libssh.git libssh…
Nhan Ly
  • 95
  • 1
  • 4
  • 12
1
vote
0 answers

ssh multithread server remains blocked in ssh_bind_accept

I implemented an SSH server using libssh 5.5. Running a single ssh client connecting to the server on port 22, all works fine. The problem arises when I try to connect a second client (I use PUTTY ssh terminal as clients). The server thread waiting…
FrizzTheSnail
  • 1,048
  • 11
  • 21
1
vote
1 answer

SSH tunnel using libssh and c lang

I am trying to use libssh to open an SSH tunnel. Basically, I have two hosts in the way. First, I would need to SSH to the first one (I have already done this part), then I would need to SSH from that host to the second host: [my PC] --SSH--> [host…
user1935345
  • 11
  • 1
  • 2
1
vote
0 answers

Undefined reference to `ssh_new'

Possible Duplicate: Noobish, linker errors when compiling against glib…? I have the following Makefile: remote: RemoteCMD.o sshlib.o g++ -L/usr/include/libssh -lssh RemoteCMD.o sshlib.o -o RemoteCMD RemoteCMD.o: RemoteCMD.cpp g++ -c…
vlad417
  • 313
  • 1
  • 3
  • 10
1
vote
2 answers

libssh2 session cleanup without blocking?

My app uses libssh2 to communicate over SSH, and generally works fine. One problem I have is when the remote host dies unexpectedly -- the remote host in this case is an embedded device that can lose power at any time, so this isn't uncommon. When…
Jeremy Friesner
  • 70,199
  • 15
  • 131
  • 234
0
votes
2 answers

libssh not return command results

I am using libssh to send a remote command to a computer. This command is real time so I am trying to get databack as it is generated. Basically I am hexdumping a mouse event and I want that data as it comes in. How can I make this return realtime…
lodkkx
  • 1,163
  • 2
  • 17
  • 29
0
votes
3 answers

Why does this program pass parameters by reference

I am writing some code for a linux program I am working on that requires libssh. I was looking at their tutorial page and I saw that it passes all the parameters to ssh_options_set() by reference. Why is that? #include #include…
lodkkx
  • 1,163
  • 2
  • 17
  • 29
0
votes
1 answer

Diagnosing libssh2 SFTP blocking call

I'm using the most recent Git tree of libssh2 to perform some SFTP work. I'm using the non-blocking interface. I'm successful in establishing a connection to the SFTP server, logging in, and transferring files. However, I'm encountering a problem…
mpenkov
  • 21,621
  • 10
  • 84
  • 126
0
votes
0 answers

writing ardude commands remotely via libssh

I'm writing a code in C++ with libssh and i want to connecting via ssh to Raspberry Pi 3 and remotely writing AVRdude commands in Raspberry. It is possible? Below is my code: #include #include #include #include…
0
votes
0 answers

Connection and port forwarding with libssh library

I have an SSH server through which I can access remote computers. After connecting to the SSH server, I create several tunnels to the remote computer with different ports to access different services and then just maintain the connection. We used to…
0
votes
0 answers

metrics are not displayed on localhost:9091

I am writing code to remove metrics from a remote server and output them to localhost:9091. My problem is that I can't understand why the metrics are not displayed on localhost:9091 despite the fact that there is a connection to the server and the…
paffosx
  • 86
  • 4
0
votes
1 answer

libssh 0.10.4 unable to proceed with key exchange

Using the latest libssh 0.10.4 ssh_connect operation is failing at the key exchange step. Following is the log. [2023/01/09 16:37:44.874356, 2] ssh_connect: libssh 0.10.4 (c) 2003-2022 Aris Adamantiadis, Andreas Schneider and libssh…
Antarus
  • 1,573
  • 2
  • 15
  • 32
0
votes
1 answer

Unable to link libssh in Cmake

I am trying to compile C++ Qt app that needs a connection to a ssh server, but I am unable to do it, as every time I try to compile it, I am getting the following error code: [1/1] Linking CXX executable SSH-Manager FAILED: SSH-Manager : &&…
hra-ved
  • 3
  • 3