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

Linux PHP Site Converting from FTP to SFTP

I took over a php website running on Linux. We need to convert from using ftp to sftp. The code prompts the user for the local file and then uses ftp to put the file on the local server. Currently we are using the following: $ftp_user =…
77Vetter
  • 209
  • 3
  • 16
0
votes
0 answers

Azure KeyVault Key Client returns JSONWebKey on getKey method. How to get private key as blob or buffer?

I'm using the @azure/keyvault-keys package to get the pem private key I uploaded to the Azure KeyVault. Now I would like to retrieve that and connect to SFTP like this return this.sftpClient.connect({ host, port, username, privateKey:…
user3677331
  • 698
  • 2
  • 7
  • 22
0
votes
1 answer

How to connect to SFTP server in Cypress test?

I am trying to connect to an SFTP server using the ssh2-sftp-client NPM package in my Cypress test. Here is my test at the moment describe('example to-do app', () => { it('displays two todo items by default', () => { let Client =…
user9847788
  • 2,135
  • 5
  • 31
  • 79
0
votes
1 answer

Unable to connect with the public key you've provided. Php | Codeigniter

Unable to connect with the public key you've provided.Unable to connect with the public key you've provided. i am using codeigniter 3.1.x . Keys are valid . I have test the keys using filezilla client. Everything is working but here in php…
Asad Ali
  • 31
  • 4
0
votes
0 answers

NodeJS: Improve SFTP server performance

I am trying to render images and PDF files from a SFTP server using ssh2-sftp-client module, but it is very slow and I am wondering if there is any way to improve the performance of requests. For a file about 168 KB it takes more than 1.5s so it's…
Eduardo Jiménez
  • 351
  • 3
  • 13
0
votes
1 answer

promise-sftp hangs after 'put'

I am working on a NodeJS component uploading a file to an SFTP server using promise-sftp version 0.11.3. I am basically doing these steps: const PromiseFtp = require('promise-sftp'); const ftp = new PromiseFtp(); await ftp.connect(...); await…
walderich
  • 500
  • 1
  • 9
  • 24
0
votes
0 answers

Obtaining files via ssh2_scp_recv in php

For a project i need to retreive all the files on a sftp server with a total size that amounts to about ~100 mb among all the files. I developed a script thats uses the ssh2 library and fread to get all the files, but it takes arround 10 min to get…
0
votes
1 answer

How to upload file from S3 bucket to server (SFTP) in NodeJS?

I am trying to use ssh2-sftp-client in NodeJS to send a file from an S3 bucket in AWS to my server. I have seen many examples and I have tried them all with no success. I feel that this one is close but still is not working for me: async function…
mastercool
  • 463
  • 12
  • 35
0
votes
1 answer

Write buffer data to SFTP server using Node and SSH2

I am trying to implement writing files to an SFTP server in Node using the SSH2 module. For my use case, the file source is Azure Blob Storage, and files are relatively large (more than 5 gigs) and so the idea is to capture data from blob storage in…
0
votes
1 answer

How to increase the performance of a file upload using native sftp functions and fwrite in PHP

Hi I am using the following code to upload a huge file (500MB) to a sftp server. host, $this->port, null); $sftp = ssh2_sftp($connection); $connection_string = ((int) $sftp) . $remotePath .…
intxcc
  • 75
  • 7
0
votes
0 answers

ssh2_sftp cannot find files with $ sign as part of the name

I am running into a bit of a situation here. I have an external party that provides certain files to me via SFTP. These files' names contain some special characters in them. For example 4569278-04?$example$.jpg The problem is, by doing the…
Mozammil
  • 8,520
  • 15
  • 29
0
votes
1 answer

ssh2_connect(): Error starting up SSH connection(-43): Failed getting banner

Have a docker container build using php-ssh2. php version 7.2 When trying to use $con = ssh2_connect('hostname'); I am getting Error starting up SSH connection(-43): Failed getting banner . Interesting thing is 43 here. Whats the significance of…
Kingshuk Deb
  • 1,700
  • 2
  • 26
  • 40
0
votes
1 answer

Retrieving a ppk file from SecretsManager and passing to ssh2-sftp-client

I am trying to retrieve the contents of a ppk file from secrets manager and use it to connect to SFTP. I can do it easily if I store the file locally and pass the file. const sshConfig = { //This works host: 'host', port: 22, username:…
MountainBiker
  • 327
  • 5
  • 20
0
votes
1 answer

Best practice for storing a user's ppk file in AWS?

I need to connect to SFTP from lambda function in node.js. const Client = require('ssh2-sftp-client'); const config = { host: 'host', port: 22, username: 'user', privateKey: 'location of privatekey file', password: 'passphrase' }; I will access…
0
votes
1 answer

Upload image URL to SFTP server using Cloud Function

I am working on a task that uploads image to SFTP server with Firebase Function. But the image source is not from my local computer but a http URL such as https://image.com/abc.jpg. I am using ssh2-sftp-client npm package. Currently I am using my…
M.K. Kim
  • 481
  • 1
  • 4
  • 17
1 2 3
8 9