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
2
votes
2 answers

SFTP with public key failing without error

I'm using SSH-DSS key, port is 2222. I'm able to connect through winscp from my machine using public/private keys (peagent) and username. (Private key is without passphrase) But when I try the same with PHP script it doesn't work. No error message.…
Swapnil
  • 31
  • 2
2
votes
0 answers

Why does SFTP via PHP fail, but succeeds in FileZilla on my Windows 8.1 machine?

In PHP, I cannot even get the SFTP connection to work. I have tried to use the native SFTP functionality (ssh_connect), and it fails to connect. I have also tried to use phpseclib, but it fails as well. Neither of my aforementioned attempts have…
Sean Charles
  • 267
  • 3
  • 18
2
votes
1 answer

Wordpress sftp automatic update - Could not find the wp-content directory

I am trying to configure the sftp automatic update on Wordpress. It does not work: I always got "wp-content can not be found". The configuration I have is as follow: each site has its owned user the site is located under user home directory :…
Vénizia
  • 581
  • 5
  • 14
2
votes
2 answers

php download file from different server

My application is on Server A and database in on other server Server B. With mysql outfile into /tmp directory of Server B. I want to download this file using php code on Server A
Aruti
  • 73
  • 6
2
votes
2 answers

PHP SSH2 operations failing when attempting to upload file to server

I am currently struggling with using the SSH2 built-in libraries for PHP (running version 5.5). I am trying to upload a file to an SFTP server as the title states however I keep getting a "stream operation failed" error message. After attempting to…
user3498133
  • 195
  • 3
  • 15
2
votes
0 answers

Unable to load ssh2.so extension

Im getting an error loading ssh2 extension in lampp. This is the error that I receive when I use this command /opt/lampp/bin/php -r "print_r(stream_get_wrappers());" Warning: PHP Startup: Unable to load dynamic library…
tanix
  • 71
  • 1
  • 9
2
votes
1 answer

SSH2 in php, wamp,windows

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…
Ank
  • 73
  • 2
  • 7
1
vote
0 answers

How to create file on SFTP server in Cypress test

When I call the createFile() function in my Cypress test, I am trying to create a file on a hosted SFTP server. Currently, when I call it, I get the following error message: The following error was thrown by a plugin. We stopped running your tests…
user9847788
  • 2,135
  • 5
  • 31
  • 79
1
vote
1 answer

Outgoing SFTP Timeouts on DigitalOcean App Platfrom

I have a Node app that needs to dump (a small number of small) XML files to an external SFTP server. I'm using the 'sftp-sync-deploy' SFTP sync library, and the app works fine locally, but once deployed to the DigitalOcean App Platform, I get SFTP…
Dycey
  • 4,767
  • 5
  • 47
  • 86
1
vote
1 answer

Download file to AWS Lambda using SSH client

I am trying to download a file from an EC2 instance and store it temporarily in the tmp folder inside AWS Lambda. This is what I have tried: let Client = require('ssh2-sftp-client'); let sftp = new Client(); sftp.connect({ host: host, …
1
vote
1 answer

Programmatically move files from an S3 bucket to a Windows EC2 and vice-versa

I want to push files to a Windows EC2 and also get folders from my EC2 and store it in S3. As I have many EC2s, I wanted to automate this - I currently have a Node.js server on ECS that uses ssh2-sftp-client library. With the following piece of code…
1
vote
0 answers

parsing writable stream data to JSON?

I am writing received data (CSV) to a local txt file and want to parse it as JSON before it writes into my local file, any suggestions? .then(async data => { const filteredFile = data.filter(file => { let currentDate = moment(); let…
ads6495
  • 33
  • 4
1
vote
1 answer

NodeJS SSH2 not authenticating, with known host defined

I am trying to transfer files from one server to another using SSH2 in NodeJS. However, our network admins have setup the private keys for the authorized user and basically just made it possible to connect to the other server via command line like…
TheJason
  • 494
  • 6
  • 18
1
vote
1 answer

Not able to download big file from SFTP using node js

i m trying to download 4 GB file from SFTP using node js using ssh2-sftp-client module. My main problem is around 40%(not to be exact sometimes 45 also) of file get downloaded after than downloading stops neither an error occurs not any progress is…
bab951
  • 41
  • 12
1
vote
1 answer

NodeJS: Read csv file from sftp server and convert it to JSON

I am using ssh2-sftp-client to read a CSV file and create a ReadableStream. Then I am trying to convert this readableStream to Json with the help of the library csvtojson. However, I always get the following error: TypeError: readStream.pipe is not…
threxx
  • 1,213
  • 1
  • 31
  • 59
1 2
3
8 9