Questions tagged [libssh2]

A client-side library that implements the SSH2 protocol.

A client-side library that implements the SSH2 protocol.

More information here.

292 questions
1
vote
1 answer

Compile libssh2 based C code (and generate the exe) on windows

I could successfully build the libssh2 library for windows using Compiling libssh2 on windows. I am not able to figure out the command to compile a simple C program on a windows system that uses libssh2 , say any example code from…
jainsha
  • 63
  • 5
1
vote
1 answer

libssh2_session_handshake return -43

Here was a ssh server at My win10, than When I ran the demo named example-ssh2 builded by visual studio 2015 from libssh2 1.90. I saw the tcp socket was ESTABLISHED. session = libssh2_session_init() was…
sculida
  • 11
  • 3
1
vote
1 answer

'UnsafePointer' is not convertible to 'UnsafePointer<_>

I am trying to implement to write a wrapper around libssh2 using Swift. The following code is for removing a file via SFTP. func removeFile(_ path: String) { let data = path.data(using: String.Encoding.utf8)! let result =…
Codey
  • 1,131
  • 2
  • 15
  • 34
1
vote
2 answers

Download and store remote password protected file with PHP

When I type into any browser's address bar : https://username:password@www.example.com/Protected/Export/MyFile.zip, the file gets downloaded normally. Now I'm trying to do the same with PHP : connect to the remote password-protected file and…
user11935130
1
vote
3 answers

Waiting for command to finish using SSH2_Shell in PHP

I have an SSH2_Shell session working in PHP. my issue is that i need a command to completely finish before moving onto the next command. Here is my code so far: $command_capture = "cd /mnt/NADS/scripts/"; $command_capture2 = "./tcpdump.sh…
Josh Michaud
  • 11
  • 1
  • 2
1
vote
1 answer

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 call sftp = sftp_new(session);. Do I have to…
phoebus
  • 1,280
  • 1
  • 16
  • 36
1
vote
1 answer

perl Net::SSH2 channel exec timeout

I'm using Net::SSH2 to run slow admin commands on remote hosts. Perl 5.8.8 libssh2 1.2.2 I keep getting a strange "timeout" on channel exec. $chan->exec( $command ); The commands being executed are normally running up to an hour (60 min) with…
peitur
  • 121
  • 13
1
vote
0 answers

unable to send more than 10kb file using ssh2_scp_send() function

I have live site is running with below location like /cloud/domains/live/domains/domain.com/http If I transfer file less than 10 KB it's working fine. But when I transfer file more than 10 KB then not working. $connection = ssh2_connect("MyHost",…
hardik
  • 197
  • 10
1
vote
0 answers

Why is git2r failing to install?

When I try to install devtools in R via RStudio Server on my Red Hat Linux machine it fails because it cannot install git2r. When I then try to install git2r, it fails to install. I think it might be because I need to install libssh2 on my Linux…
Ursus Frost
  • 405
  • 1
  • 7
  • 14
1
vote
1 answer

PHP: ssh2_connect: cant connect to localhost or machine remotely

For the sake of my explanation, keep the following im mind. Machine 1 Internal = 127.0.0.1 Machine 1 External = 192.0.0.1 Machine 2 Internal = 127.0.0.2 Machime 2 External = 192.0.0.2 Client External = 10.0.0.1 So, I will try to connect to the…
Nic Plants
  • 11
  • 1
1
vote
1 answer

How to link .so file to a cpp program

I have libssh2.so.1.0.1(.so) binary on my local machine and I don't have any header files present on my machine. This is the basic ssh program I have been trying to connect to my server through ssh protocol. Reference: How to establish a simple ssh…
user3398900
  • 795
  • 2
  • 13
  • 31
1
vote
1 answer

Create Folder on SFTP server using ssh2 npm module in NodeJS

I am using the this npm module for my SFTP iplementation. As I need to create a folder on my SFTP server where I can upload my file. I have read the documentation but nothing is mentioned about this. How to create a folder on SFTP server using ssh2…
Ankit Uniyal
  • 424
  • 1
  • 7
  • 20
1
vote
1 answer

Can you use ssh2_scp_recv in php to get a remote directory?

I am trying to use ssh2_scp_recv($connection, '/remote/directory', '/local/directory'); to get a remote directory, but I am getting the error: Warning: ssh2_scp_recv(): Unable to receive remote file in /some-php-file.php on line 2. It works if I…
1
vote
1 answer

Wordpress - The ssh2 PHP extension is not available

I use SSH keys in my wp-config since a long time. Updates, plugin installation and removal, all worked well. After the last apt-get update wp is asking for the FTP password when I try to install for example a plugin. There was no change done to the…
MikeSkril
  • 77
  • 1
  • 9
1
vote
2 answers

Libssh2 - libssh2_scp_recv2 function

Can someone explain me the libssh2_scp_recv2() function from libssh2 lib? According to this I need to input the session var (LIBSSH2_SESSION *session), the path to the file I want (const char *path) and a struct with information of the file I want…
Samega 7Cattac
  • 253
  • 1
  • 3
  • 16