Questions tagged [ssh2-sftp]

Request the SFTP subsystem from an already connected SSH2 server.

Request the SFTP subsystem from an already connected SSH2 server. An SSH connection link identifier, obtained from a call to ssh2_connect(). This method returns an SSH2 SFTP resource for use with all other ssh2_sftp_*() methods and the ssh2.sftp:// fopen wrapper.

Sample :

<?php
$connection = ssh2_connect('shell.example.com', 22);
ssh2_auth_password($connection, 'username', 'password');

$sftp = ssh2_sftp($connection);

$stream = fopen("ssh2.sftp://$sftp/path/to/file", 'r');
?>
125 questions
3
votes
1 answer

How can I download/upload multiple files at once using SFTP through the ssh2 Node.js module (within an Electron app)?

I am building a simple SFTP client with Electron and I am attempting to download or upload multiple files at once using the ssh2 module and the SFTPStream within that module. I have tried many different method structures, some including use of…
3
votes
1 answer

Node.js - Pushing multiple files as attachments from server to client

I have an application which allows a user to enter multiple file names into text input boxes and on submit these file names will be fetched from an SFTP server and returned back to the client and downloaded. The app looks something like this: The…
GeorgeBT1902
  • 195
  • 2
  • 14
3
votes
2 answers

No matching host key when connecting to sftp.webtrends.com

I am trying to use Firebase Cloud Functions to send a file to webtrends ftp server, but I have encountered a problem I can not get past. Since I use Firebase Cloud Functions my function is running from a nodejs server. I am using this npm package:…
3
votes
2 answers

ssh2 connect to multiple server and get the output nodejs

I am using ssh2 nodejs module to connect to a UNIX application and run a script and it is successful. Now i want to connect to multiple servers one by one and get the output and store it. When i try using a for loop to pass the servers one by one…
Sshastry
  • 57
  • 1
  • 8
3
votes
1 answer

What makes throughput of the SFTP and SCP protocols different

In windows, I have transferred a data file (8GB) with sftp and scp (secure copy protocol) and get result like this: and calculated throughput = data size/time(sec) I'm a newbie in networking. I don't know what makes the throughput of these…
T2terBKK
  • 319
  • 5
  • 12
3
votes
2 answers

ssh2_scp_send() and ssh2_scp_recv() functions are not working in php. Why?

ssh2_scp_send() function is hanging in php. Here's the code: $debug_line_feed = "\n"; $conn = ssh2_connect($sftp_server, 22); $return = ssh2_auth_password($conn, $sftp_user_name, $sftp_user_pass); if ($return===true) echo "successfull…
danjfoley
  • 778
  • 1
  • 8
  • 20
3
votes
1 answer

Error 110 Connection Timed out using phpseclib trying to upload via SFTP

I'm a newbie here, but I'll try to describe my problem as best as I can. Basically I have been trying to trigger an automated SFTP upload of a screenshot file whenever someone completes an order on my client's site. This is for a review of the…
noctis_lucis
  • 53
  • 1
  • 6
2
votes
0 answers

Apache MINA SSHD java.security.InvalidKeyException: The security strength of SHA-1 digest algorithm is not sufficient for this key size

We are running SFTP server using Apache SSHD mina. With Java 7 , everything works fine. But with Java 8, we are getting the below exception when any SFTP client is trying to connect. How to fix this issue in server side with Java 8. The client can…
JavaUser
  • 25,542
  • 46
  • 113
  • 139
2
votes
1 answer

PHP attempting to download file via SFTP but receive stat failed error when calculating filesize

Trying to download files from a SFTP location. I'm using intval on the stream as this is designed to fix a bug I've read about here: PHP 7 SSH2.SFTP stat() bug work around. I'm running PHP 7.0.33. However, it still fails on the filesize…
user2029890
  • 2,493
  • 6
  • 34
  • 65
2
votes
1 answer

looping inside SFTP promise not download file data to local file?

My overall issue is once i filtered the files which were added in the last 5 minutes i am looping over the returned array of objects. From there I'm appending the root remote file name with the name returned from files added in the last 5 minutes.…
ads6495
  • 33
  • 4
2
votes
0 answers

How to increase upload speed using sftp with PHP?

In my project, I use sftp (https://www.php.net/manual/en/book.ssh2.php) to upload file to remote server. Code upload file: if (!$localStream = @fopen($localFilePath, 'r')) { throw new Exception("Unable to open local file for reading:…
Alex
  • 3,646
  • 1
  • 28
  • 25
2
votes
1 answer

Accessing and Copying Files from SFTP server using aws lambda nodejs

I'm trying to access sftp server using an aws lambda function but it keeps returning null and I'm not sure why. The host, username and password are correct because I tested the connection using WinSCP. I also tried connecting to other free sftp…
Becca
  • 169
  • 1
  • 4
  • 12
2
votes
1 answer

Stream file through SFTP connection to client

I'm writing a Node Express server which connects via sftp to a file store. I'm using the ssh2-sftp-client package. To retrieve files it has a get function with the following signature: get(srcPath, dst, options) The dst argument should either be a…
CSharp
  • 1,396
  • 1
  • 18
  • 41
2
votes
0 answers

Passwordless connection via Paramiko's SFTPClient isn't working

I have two lxd containers, one master and the other one a slave. I have pasted the ssh-key of master into the ~/.ssh/authorized_keys of the slave, so that I can do passwordless logins from the master into the slave by simply ssh…
Mooncrater
  • 4,146
  • 4
  • 33
  • 62
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
1
2
3
8 9