Questions tagged [ssh2]

136 questions
0
votes
1 answer

php fopen ssh2 sftp connection result "Resource id #5"

By using followign code i get the result "Resource id #5" if I echo $stream I use PHP 7.0 on apache (linux) phpinfo: ssh2 extension version 0.12+dev libssh2 version 1.5.0 banner SSH-2.0-libssh2_1.5.0*
Korty
  • 309
  • 2
  • 8
  • 19
0
votes
4 answers

Install ssh2 extension having homebrew and php 7.3

I am facing the following error while trying to install ssh2 extension with pecl: 17 warnings and 3 errors generated. make: *** [ssh2_fopen_wrappers.lo] Error 1 ERROR: `make' failed Here is what I've done: brew install php brew install…
Vitalii Isaenko
  • 941
  • 1
  • 14
  • 37
0
votes
0 answers

SSH to Fortigate firewall failing using phpseclib

I am trying to execute the below command on fortigate using my php script using library phpseclib. config global exec batch start conf vdom edit [PORT_VDOM] conf firewall addrgrp edit "[GROUP_NAME]" set member "[MEMBERS]" end exec…
Dilani
  • 533
  • 1
  • 6
  • 22
0
votes
2 answers

phpseclib SSH2 write not executing long command

I am trying to execute an SSH command to a device (firewall). Command is executed when the length is short. When the length is about 1000 characters, command is not being executed. When I execute the command via putty, that is working as well. After…
Dilani
  • 533
  • 1
  • 6
  • 22
0
votes
2 answers

When I try to close ssh2 connection, no response back

I wrote a php script to execute locally, on an apache server with php7.3, doing the following: access server via ssh2 check if a file exists close connection printing json data object as a response. script works without problems except for closing…
Ahmed Nasr
  • 109
  • 1
  • 10
0
votes
1 answer

File transfer from Windows to Linux failing using ssh2 : ssh: Could not resolve hostname C: Name or service not known

I am trying to send a file from windows machine to linux server using ssh2 in JavaScript, sftp is not working so I am using exec and specifying scp command , but i am getting below error. STDERR: ssh: Could not resolve hostname C: Name or service…
Umesh Kumar
  • 1,387
  • 2
  • 16
  • 34
0
votes
2 answers

ssh2-sftp-client get multiple files - error "write after end"

I am trying to load multiple files from ftp but I am getting error: "write after end". I am not able to find the issue. connections.js async function getFtpFileContent(_path) { const ftpConfig = { host: config.FTPhost.replace('https://', ''), …
tumik
  • 1
0
votes
1 answer

SFTP in node downloads blank files only

I've been trying for a while now to download a file from my SFTP file storage to my local machine - And visited a number of stack posts - Like this one: SFTP modules in Node to download and delete files However, I cannot get it to work. I have this…
GeorgeBT1902
  • 195
  • 2
  • 14
0
votes
1 answer

Meteor MUP failed authentication using ssh ed25519

Problem I want to setup my config using mup setup. However it fails in all possible configs: { host: '1.2.3.4', username: 'root', pem: '/home/user/.ssh/id_ed25519', } Fails, where module ssh2 (which seems to be the part of MUP that handles…
Jankapunkt
  • 8,128
  • 4
  • 30
  • 59
0
votes
1 answer

save an image to sftp remote server sent by user

I want to upload a file to sftp remote server using ssh2-sftp-client. I am taking the file from user in a post request along with destination. I am using multer to process the file. const Client = require('ssh2-sftp-client'); const sftp = new…
Komal Bansal
  • 789
  • 2
  • 7
  • 20
-1
votes
1 answer

Previously-defined variable not working in other parts of test in nightwatchjs

I'm using nightwatchjs and the ssh2 npm package to test that a file name is present in a location, and asserting that it's correct. My code is as follows; var Client = require('ssh2'); var conn = new Client(); var…
Darren Harley
  • 75
  • 1
  • 18
-1
votes
1 answer

callback vs direct calling function in nodejs

Original question is what difference is there if i call a function without callback or with callback i am using ssh2 library to list directory on remote sftp server for that there is a function "readdir" if i call readdir as below it works all…
-1
votes
1 answer

consecutives commands ssh2 on php 7.2

I'm trying to run some commands in a remote firewall fortigate using ssh2 on php 7.2. Ssh connection goes ok but my problem is that in fortigate is not possible send many commands in one line, that means it is not possible "'$ command1'. ' && '.' $…
-2
votes
2 answers

What are some examples of "authHandler" in the "connect" client method of the ssh2 npm package?

What are some examples of "authHandler" in the "connect" client method of the ssh2 npm package? im namely looking to re-order the methods and/or remove some.
-4
votes
1 answer

How To connect to remote server via PHP

I am trying to connect to my SSH Server via PHP. I know I can easily connect to my ssh server via python using the parimako library. But at this time I need to do it using PHP My Server Details: ip: xx.xxxx.xxx -Username:root -Password:…
1 2 3
8
9