Questions tagged [ssh2]

136 questions
19
votes
2 answers

Cannot parse privateKey: Unsupported key format

In my Mac book pro with OS Majave, I used SSH-KEYGEN generate a new SSH key for node.js module SSH2. However, I got error message: Cannot parse privateKey: Unsupported key format I validated the key with ssh command, it just works fine. But not with…
George Zhang
  • 371
  • 1
  • 2
  • 9
7
votes
1 answer

convert readable stream to save it as a file in local

I am using ssh2-sftp-client to get the file from remote server. I am getting the file in readable stream. I want to convert this readable stream to the desired file (sample.png as a png file, sample.doc file as doc file etc.) Here is my code- let…
Komal Bansal
  • 789
  • 2
  • 7
  • 20
4
votes
1 answer

Node.js ssh2-sftp-client Error: fastPut: No response from server Local

I am using node -v v14.17.0 and "ssh2-sftp-client": "^7.0.0" and method fastPut https://github.com/theophilusx/ssh2-sftp-client#sec-5-2-9 Checking the remote files is okay, so connection works. My environment is wsl2 Ubuntu-20.04 Problem I face is…
eemilk
  • 1,375
  • 13
  • 17
4
votes
0 answers

How do I use ssh2-promise to make an interactive shell

I'm attempting to make an interactive ssh session where I can send bash cmds and get back the result. The following works: var SSH2Promise = require('ssh2-promise'); var sshconfig = { host: '192.168.1.142', username: 'root', password:…
user1343035
  • 245
  • 3
  • 13
3
votes
1 answer

How to npm i ssh2 without errors on Windows?

npm i ssh2 ends with: MSVCRT.lib(chandler4gs.obj) : error LNK2019: unresolved external symbol __except_handler4_common referenced in function __except_handler4…
manuell
  • 7,528
  • 5
  • 31
  • 58
3
votes
1 answer

Node ssh2: TypeError: is not a constructor
I have node v14.17.0 and ssh2 1.1.0 https://www.npmjs.com/package/ssh2 I have tried to get the connection working with code below but it crashes on TypeError: NodeSSH is not a constructor I have also tried var NodeSSH= require('ssh2'); var c = new…
eemilk
  • 1,375
  • 13
  • 17
3
votes
2 answers

How to use ssh2 in PHP 8.0?

I read through all the incompatibilities prior to installing php 8 updates only to find out way too late that there is no support for the ssh2 extension yet that I can find. I am hoping that I am just missing something. I have been googling for a…
Owen Parker
  • 253
  • 2
  • 12
3
votes
0 answers

ssh2-python userauth_publickey_fromfile returning FileError

When trying to call the userauth_publickey_from file method I pass in the username and the file path to the private key .ppk. However when I run it I get a FileError. I have tried putting the file path in a variable with no change session =…
tompea
  • 65
  • 5
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
2 answers

SSH2 Python How To Recognize When File Is Directory

I am converting my python program from paramiko to ssh2. I have succeeded in authenticating and I can get a directory listing. Where I am stuck is as I process through the directory listing how do I recognize whether the "file" is a directory or a…
efultz
  • 1,135
  • 2
  • 11
  • 26
3
votes
1 answer

node read stream a file from remote computer using ssh

I am trying to read data in stream from a remote server log file, which is continuously growing. I want to display the new lines added to my local console. I am using ssh for connection from local to remote server. I found below solution on github…
usersam
  • 1,125
  • 4
  • 27
  • 54
3
votes
1 answer

Node ssh2 to ssh and sudo su as a user and run commands

Using node ssh2 module, this is what I need to do 1. ssh to a server as a local user 2. sudo as oracle : sudo su oracle 3. run commands I am unable to sudo su oracle and hence cant run any commands. The local user has the privilege to become oracle…
user3439399
  • 195
  • 1
  • 3
  • 13
3
votes
1 answer

Possible to have C# SSH client communicate with a NodeJS SSH Server?

I have a C# application that needs to run certain commands on a piece of hardware over SSH. The application is using SSH.Net to make the connection, send the command, and the read the result. I have this working if I connect to my local machine…
Fizz
  • 3,427
  • 4
  • 27
  • 43
2
votes
0 answers

PHP ssh2_connect Error starting up SSH connection(-5): Unable to exchange encryption keys error

Connecting to a server which I have no direct control. Been working for 3 years with no issue. Today receive an error. The code is simply $connection = ssh2_connect('data.example.com', 22); Result on the $connection line (even before trying to…
user2029890
  • 2,493
  • 6
  • 34
  • 65
2
votes
0 answers

SSH into a server using node.js ( All configured authentication methods failed)

I have a node application that uses the ssh2(https://www.npmjs.com/package/ssh2) npm package. I am trying to SSH using this. The server has 2-factor authentication enabled. I have tried the following code and it returns as 'All configured…
1
2 3
8 9