Questions tagged [node-ssh]

9 questions
2
votes
1 answer

Node-ssh is not a constructor? How do I resolve this?

I am trying to automate deployment to an AWS server and I am getting the error: TypeError: node_ssh is not a constructor at Object. Here is the code in question. I have installed Node SSH and Node CMD Node is version 14.16.0 NPM is version…
VasilyWRS
  • 21
  • 4
1
vote
1 answer

SSH2-Promise exec() method resolving before STDOUT is returned

I am attempting to run a bash script utilizing the exec() method within the ssh2-promise library wrapper. This function is then placed inside of a beforeAll block to execute before my test cases run, and my HTTP response body should contain…
Matt
  • 13
  • 4
1
vote
1 answer

Node JS child process error The "message" argument must be defined

While Trying to use child Process to have a multiple ssh connection I got this erroryour text ` inside process.on node:internal/child_process:754 throw new ERR_MISSING_ARGS('message'); ^ TypeError [ERR_MISSING_ARGS]: The "message"…
Aavasah
  • 13
  • 2
0
votes
2 answers

ssh key format node.js

I've tried using ssh2 and node-ssh libraries to connect, but I always get "Cannot parse privateKey: Unsupported key format" I'm getting the key from AWS secret manager in this format -----BEGIN PRIVATE KEY----- ....---END PRIVATE KEY-----, I tried…
NadavT
  • 63
  • 4
0
votes
0 answers

Error: Cannot parse privateKey: Unsupported key format in Windows 11

I tried changing the private key format using the command ssh-keygen -m PEM -p -f ~/.ssh/id_rsa, but I am still getting the same error. For now, I am trying to connect with my system only. I don't understand what's wrong I am doing. ssh.connect({ …
Divya mishra
  • 1
  • 2
  • 3
0
votes
0 answers

Node-ssh timeout exception

I'm creating service on node.js and have a small problem with module node-ssh ssh.connect({ host: server.ssh.host, port: server.ssh.port || 22, username: server.ssh.username, password: server.ssh.password}) .catch((e) => { log( …
Dafik
  • 101
  • 1
  • 1
  • 8
0
votes
1 answer

Error:read ECONNRESET - I cannot successfully authenticate with the hp-ux server in node.js

I have a problem with the connection into a hpux server that we host locally in our local network. I get the following error: Hello world Connected to Nemesis true rejected: Error: read ECONNRESET at TCP.onStreamRead…
Craig
  • 64
  • 9
0
votes
1 answer

Can't get virsh list in node-ssh

app.js: const fs = require('fs') const path = require('path') const {NodeSSH} = require('node-ssh') const ssh = new NodeSSH() ssh.connect({ host: '192.168.0.2', username: 'ubuntu', password: '123456' }) .then(function() { …
徐奕群
  • 3
  • 1
0
votes
1 answer

Reading the contents of a remote file without writing it locally

I am using getFile() to get a file from a server and this works fine. But would it be possible to get the contents of a file on the server and put it in a variable instead of saving it first locally?
Sander_P
  • 1,787
  • 1
  • 13
  • 37