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
2
votes
1 answer

Libssh2: Is safe to share ssh session between threads on "channel per thread" basis?

Suppose I establish ssh connection, then create several channels with libssh2_channel_open_session() - all in one main thread. Then I create a thread for each channel, and these threads start to write and read from their channels. Each thread uses…
Dmitry J
  • 867
  • 7
  • 20
2
votes
2 answers

Behaviour of libssh2_channel_write when channel is not blocking

From libssh2_channel_write_ex man page: Actual number of bytes written or negative on failure. LIBSSH2_ERROR_EAGAIN when it would otherwise block. While LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per …
kriss
  • 23,497
  • 17
  • 97
  • 116
2
votes
2 answers

libssh2 and Terminal Mode Encoding

The Guacamole project is using the libssh2 library to create SSH connections to servers. One of the things we've determined is that it would be useful to pass through the VERASE terminal mode encoding option in SSH so that the remote system has a…
Virtually Nick
  • 358
  • 2
  • 8
2
votes
2 answers

Perl - How to make a library specific to individual threads

I am writing a multi threaded script in perl. In which I am using a library Net::Netconf::Manager which inturn uses Net::SSH2. This Net::SSH2(libssh2) doesn't seem to be thread safe when 'shared handles' simulataneously. I quote as in libssh2…
Bala Krishnan
  • 374
  • 3
  • 18
2
votes
0 answers

Libssh2 with WinCNG unable to obtain public key from private key with passphrase

I'm using libssh2 with WinCNG. It is failing to extract public key from a private key + passphrase pair. I see in wincng.c _libssh2_wincng_load_pem(LIBSSH2_SESSION *session, const char *filename, …
Rahul
  • 21
  • 1
2
votes
0 answers

libssh2 - Preserve mtime using scp

I have a problem with preserving mtime. This piece of code does not set my mtime. it sets the current time on the remote instead. I am using the same code as in example https://www.libssh2.org/examples/scp_write.html Except for the line 166 channel…
LennyLinux
  • 93
  • 11
2
votes
1 answer

Write string to remote file using libssh2

I'm try to use libssh2 to write a string to a file. And I can do it. The problem is I only can write once to the file, I can't append to the file, and giving the arguments to the libssh2_scp_send I give the size, if the size is bigger then the real…
Samega 7Cattac
  • 253
  • 1
  • 3
  • 16
2
votes
1 answer

Perl Net::SSH2 Output limit?

I'm stucked on a perl script. It should return me at least 5000 lines that look like this (header just fyi): Interface ----- CMTS Measurements ----- --------- CM Measurements --------- (DS-US) USPwr USSNR …
n. traber
  • 29
  • 2
2
votes
1 answer

opendir on ssh2 never stops

I need to fetch some files from the root directory of a distant server through ssh, the local machine uses php7. I've made this script:
OSdave
  • 8,538
  • 7
  • 45
  • 60
2
votes
1 answer

Use libssh2 to connect to SFTP server that requires a Key AND Password

I have been tasked with connecting to a windows based SFTP server that requires a key AND password to connect to it. I have worked out how to connect with a password or Key, but I can't work out how to do it with both. Connect via Key: //connect to…
Mike
  • 511
  • 3
  • 10
  • 28
2
votes
5 answers

SSH2 Not Working On New Server

We have changed hosting companies and where ssh2 was working it no longer works. We have ssh2 enabled on the new server along with allow_url_fopen enabled. The only difference I can see is that the old server used PHP 5.4.45 and the new server is…
SeniorDeveloper
  • 886
  • 1
  • 12
  • 22
2
votes
0 answers

How could be deprecated Net::SSH->poll avoided

Net::SSH2->poll doc: Deprecated: the poll functionality in libssh2 is deprecated and its usage disregarded. Session methods "sock" and "block_directions" can be used instead to integrate Net::SSH2 inside an external event loop. Can someone provide…
palik
  • 2,425
  • 23
  • 31
2
votes
1 answer

"C compiler cannot create executables" in libssh2 during npm install

I got the following error during npm install of nodegit: > nodegit@0.15.1 preinstall /home/mhu/nodegit > node lifecycleScripts/preinstall [nodegit] Running pre-install script [nodegit] npm@2 installed, pre-loading required packages [nodegit]…
Calvin Hu
  • 3,595
  • 4
  • 18
  • 23
2
votes
1 answer

How to install SSH2-Lib for PHP7 on Linux Ubuntu Wheezy (raspbian)?

I decided to install the new PHP7. Due to the old raspbian repository, it was impossible to apt-get install it. Ondrej's ppa wouldnt work either, because there is no wheezy upload. Everything went fine and my Apache is connected with PHP7, so it…
Sauerbrei
  • 443
  • 4
  • 14
2
votes
1 answer

node js:Not able to catch 'error' in ssh2 connection on MacOSx/Linux

this.connection = new Connection(); //ssh2 connection async.waterfall([function(callback) { // some initialization code to connect } }], function(err, opts) { if (err) { callback({ …
Abbas
  • 3,144
  • 2
  • 25
  • 45