ssh-utils

1.0.3 • Public • Published

THIS IS A WORK IN PROGRESS

a nodejs module to help work with SSH

Install

npm install ssh-utils

Usage

"use strict";
 
var execCmd = require('ssh-utils').exec.command;
var catFile = require('ssh-utils').readFileContent;
 
var cnx = {
    "host": "127.0.0.1",
    "username": "bobMarley",
    "password": "ja"
};
 
execCmd(cnx, 'ls -l')
.then(function(result){
  console.log(result);
  return catFile(cnx,'/etc/hosts')
  .then(function(hosts){
    console.log(hosts);
  })
  .fail(function(err){
    console.log("1. error");
    console.log(err);
  });
})
.fail(function(err){
  console.log("2. error");
  console.log(err);
});

Readme

Keywords

Package Sidebar

Install

npm i ssh-utils

Weekly Downloads

1

Version

1.0.3

License

ISC

Last publish

Collaborators

  • raoul2000