libssh2

SSH2 in php, wamp,windows

允我心安 提交于 2019-12-12 10:12:52
问题 I have to connect sftp link and have to put data in sftp link. I want to connect sftp link through function ssh2_connect . My trouble is that whenever i am running that function i am getting error Call to undefined function ssh2_connect() . Then I downloaded libssh2.tar.gz and ssh2.tgz but i dont know where to install / put these files. I am using - Windows 7, Wamp server, mysql, php P.O. - If i have to run come commands then please tell also where i have to run that commands. Thanks in

PHP ssh2_exec stream hanging

戏子无情 提交于 2019-12-11 15:12:36
问题 I've been trying to get ssh2_exec to run and return the response from the remote host, but cannot figure out the proper way to do this. I thew this function together based on what others have recommended, but the function always hangs once it gets to stream_get_contents($errorStream); . The command I'm running is ls -l so it should be executing very quickly. public function exec($command) { $stream = ssh2_exec($this->ssh, $command); if (! $stream) { throw new exception('Could not open shell

PHP ssh2_exec() from Ubuntu Server to Windows with OpenSSH in Cygwin - works but fails the second time

懵懂的女人 提交于 2019-12-11 06:33:30
问题 I had been using PHP's ssh_connect() and multiple ssh_exec() between two Ubuntu VMs without any problems. However, now I need to call multiple ssh_exec() from Ubuntu Server to Windows machine via OpenSSH/Cygwin . The result from ssh2_exec() in the following code prints an Array of files located at /var/www the first time, but returns empty array the second or more times. If I use ssh2_connect before the second ssh_exec() it returns an array of files again. I even attempted to use phpseclib

supplied resource is not a valid SSH2 SFTP resource

拜拜、爱过 提交于 2019-12-11 06:24:30
问题 <?php $ssh = ssh2_connect('domain.tld'); ssh2_auth_password($ssh, 'username', 'password'); $start = microtime(true); $sftp = fopen('ssh2.sftp://'.$ssh.'/home/username/1mb', 'w'); fwrite($sftp, str_repeat('a', 1024 * 1024)); $elapsed = microtime(true) - $start; echo "took $elapsed seconds"; That code snippet gives me a PHP Warning: fopen(): supplied resource is not a valid SSH2 SFTP resource in ... error. Why? $sftp = fopen('ssh2.sftp://username:password@domain.tld:22/home/user/1mb', 'w');

stream_context_set_params not works with ssh2.sftp wrapper

折月煮酒 提交于 2019-12-11 03:22:54
问题 I want to use functionality like here. Please check the code bellow function notify ( $notification_code, $severity, $message, $message_code, $bytes_transferred, $bytes_max ) { echo "Runned \n"; }; $ctx = stream_context_create(); stream_set_params($ctx, array('notification' => 'notify')); $ssh_connection = ssh2_connect('myhost'); ssh2_auth_password($ssh_connection, 'login','pass'); $sftp_resource = ssh2_sftp($ssh_connection); $data = file_get_contents("ssh2.sftp://{$sftp_resource}/path/to/big

libgit2 with libssh2 and libopenssl on windows

99封情书 提交于 2019-12-10 12:13:57
问题 I’ve tried before and had little success in the full build but even that fails now and I'm obviously missing something on windows (and yes its probably windows :P) can someone walk me through finding the correct OpenSSL to compile with libssh2 actually cmake/compiling libssh2 into libgit2 cause it keeps saying cannot find libssh2 and I'm struggling to build it again. I'm using CMake gui For windows, trying to build a VC2015 project The error I was getting when building libgit2 is checking for

Perl - How to make a library specific to individual threads

▼魔方 西西 提交于 2019-12-10 11:14:09
问题 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 website Thread-safe: just don't share handles simultaneously I am not sure what this "sharing handles" mean. Also I would like to know how to 'not share handles'. When I run my script, occasionally i see error trace with backtrace and memory map

libcurl with libssh2 - one or more libs available at link-time are not available run-time

泄露秘密 提交于 2019-12-08 01:56:54
问题 I get the following error when trying to ./configure libcurl 7.22.0 one or more libs available at link-time are not available run-time. Libs used at link-time: -lssh2 -lssl -lcrypto -lrt -lz When I ./configure with --without-libssh2 it works just fine. Steps I have taken: apt-get install libssl-dev apt-get install libssh-dev cd /var wget http://www.libssh2.org/download/libssh2-1.3.0.tar.gz tar -zxvf libssh2-1.3.0.tar.gz cd libssh2-1.3.0 ./configure make make install SSL support works fine, by

Use pty with ssh2 in node to execute command with sudo

孤人 提交于 2019-12-08 01:50:33
问题 I need to launch a command with sudo over ssh using npm ssh2 module for node.js; only reading module's documentation I can't figure out how to use the pty option: ssh.on('ready', function() { //not working sudo command: ssh.exec('cd /var/www/website && sudo mkdir myDir', { pty: true }, function(err, stream) { if (err) throw err; stream.on('exit', function(code, signal) { console.log('exit code: ' + code + ' signal: ' + signal); ssh.end(); }); }); }).connect({ host: configuration.sshAddress,

libcurl with libssh2 - one or more libs available at link-time are not available run-time

喜夏-厌秋 提交于 2019-12-06 11:10:54
I get the following error when trying to ./configure libcurl 7.22.0 one or more libs available at link-time are not available run-time. Libs used at link-time: -lssh2 -lssl -lcrypto -lrt -lz When I ./configure with --without-libssh2 it works just fine. Steps I have taken: apt-get install libssl-dev apt-get install libssh-dev cd /var wget http://www.libssh2.org/download/libssh2-1.3.0.tar.gz tar -zxvf libssh2-1.3.0.tar.gz cd libssh2-1.3.0 ./configure make make install SSL support works fine, by the way. I must have done something wrong with libssh I have also tried: ./configure --with-libssh2 .