Quantcast
Channel: Active questions tagged amazon-ec2 - Stack Overflow
Viewing all articles
Browse latest Browse all 29396

How to ssh to amazon centos via ssh-node

$
0
0

Stupid question, trying to connect to my amazon centos instance using node-ssh

at terminal connecting: ssh -i myCert.pem centos@10.10.10.10

let fs = require('fs')
let path = require('path');
const node_ssh = require('node-ssh');
const ssh = new node_ssh();

ssh.connect({
  host: 'http://10.10.10.10',
  username: 'centos',
  privateKey: myCert.pem
}).then(resp => {
  console.log(resp);
  ssh.dispose();
});

Here getting an error:

{ Error: getaddrinfo ENOTFOUND http://10.10.10.10 http://10.10.10.10:22
  at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:58:26)
  errno: 'ENOTFOUND',
  code: 'ENOTFOUND',
  syscall: 'getaddrinfo',
  hostname: 'http://10.10.10.107',
  host: 'http://10.10.10.10',
  port: 22,
  level: 'client-socket' } 'ERROR'

Viewing all articles
Browse latest Browse all 29396

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>