Questions tagged [ssh2]

136 questions
0
votes
1 answer

Getting "Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client" while using Axios

I am trying to use different Axios calls to get some data from a remote server. One by one the calls are working but as soons as I call them directly after each other its throwing the error message about the headers. I did some research already and…
Vale
  • 3
  • 1
0
votes
1 answer

Nodejs ssh2 server detect keystrokes

I'm trying to craete an interactive ssh server in nodejs which can handle a keypress on the client side like in a normal linux ssh session when you start an mc and afte you can use the arrow keys. I found the ssh2 package, but it can parse the data…
esemve
  • 360
  • 2
  • 10
0
votes
1 answer

return value from a function node js ssh2

how to return the values (data) of the getData function bellow? const { Client } = require('ssh2'); const conn = new Client(); function getData() { //i tried to assign the data to a variable but failed //var rawData = ''; …
0
votes
0 answers

ssh2_scp_recv() prints warning: "Unable to receive remote file"

I have the following simple code, to connect to a local server and retrieve an index.php file. $username = "Admin"; $password = "Admin"; $url = "192.168.1.33"; $connection = ssh2_connect($url); if (!ssh2_auth_password($connection, $username,…
Dokik
  • 364
  • 2
  • 9
0
votes
0 answers

Why stream_get_contents not working with ssh2?

I use next code for receiving time of server Debian:
0
votes
1 answer

SSH2 (PHP ext) long command gets malformed. (escaping code issue?)

[1D gets into long commands and break them. I have same issue in phpseclib and SSH2 PHP extension. Putty works without issue. Here is SSH2 code: $stream = ssh2_shell($session, "vt100", null, 200, 25, SSH2_TERM_UNIT_CHARS); …
Harrier
  • 1
  • 1
  • 2
0
votes
2 answers

How can I install php8.0-ssh2 from an Alpine Docker image

Here is the Dockerfile (see below) that I use for my projects. Could you explain to me how to install php8.0-ssh2 from this Dockerfile. FROM php:8.0.0-fpm-alpine ARG UID ARG GID RUN apk add --no-cache mysql-client msmtp perl wget procps shadow…
FloWebDev
  • 11
  • 3
0
votes
1 answer

NodeJS ssh2 Previous Commands Persisting

I am using ssh2 library with express js. The client sends a POST request to the express api, which then should create some file, and then uses ssh2 to copy the file from one directory to another, and eventually will execute another shell command on…
Andrew Baker
  • 57
  • 1
  • 9
0
votes
0 answers

Can I use ssh2 npm to connect the FTP Server?

// Sample FTP Code // ------------------ try { const Client = require('ssh2').Client; const conn = new Client(); var ftpConfig = { host: 'ip', port: port, username: 'username', password: 'password' …
Rabeesh
  • 31
  • 9
0
votes
1 answer

ssh2 connection to sftp server not working in laravel

I'm trying to connect to a sftp server with ssh2_php extension in a lavarel proyect. The connection work great in a simple php script but the same code doesn't working when i take it to a controller in a blank laravel project. This is the code of…
pablo
  • 121
  • 2
  • 10
0
votes
0 answers

How do I append a new line to a bash file using Laravel's file append method?

I am attempting to insert a new line so the dynamic callback can be added however I'm not having much success; the curl isn't on a brand new line which breaks the script. It is instead on the last line alongside a…
Infinity
  • 13
  • 3
0
votes
0 answers

ssh2 test not shutting down when using nightwatchjs tag

I'm running a javascript test that checks some remote file details using the nodejs package ssh2. My current code works Ok, and the tests completes in a matter of seconds; var Client = require('ssh2').Client; var conn = new…
Darren Harley
  • 75
  • 1
  • 18
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

Paramiko hangs on channel.makefile.read() in a while loop

I haven't been able to resolve this issue, but I suspect it's easy for someone familiar with Paramiko/ssh2 to figure out. The code below works fine when executed only once, but when wrapped in a while loop it hangs on stdout.read(). I could not use…
selamjie
  • 68
  • 8
0
votes
0 answers

file_get_contents(id_rsa): failed to open stream: No such file or directory in ssh configuration

i am working on ssh2 key authentication in key authentication the function file_get_contents() showing the error, here is the code $name = $_FILES["file"] ["name"]; if($typer == 'start'){ $ssh = new Net_SSH2($host); $key = new…
Ajmal
  • 99
  • 1
  • 6
1 2 3
8 9