Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
@zodern/nodemiral
Advanced tools
Fork of https://github.com/arunoda/nodemiral
Changes:
npm install @zodern/nodemiral
sshpass
) or with a pem
filecopy
, execute
and executeScript
at core methodsvar nodemiral = require('@zodern/nodemiral');
var session = nodemiral.session('hostname', {username: 'root', password: 'password'});
session.execute('uname -a', function(err, code, logs) {
console.log(logs.stdout);
});
Create a session to a remote server. You can invoke following methods after created a session
@param hostname - hostname or ip addess
@param auth - object containing following fields: `username` and (`password` or `pem`)
@param options - object of options described below
nodemiral.session(hostname, auth, options);
options
:
ejs
- ejs options with ejs
fieldsssh
- object whose key and value will be passed as -o key:value
to any ssh session. For example { 'StrictHostKeyChecking': 'no', 'UserKnownHostsFile': '/dev/null' }
execute given shell command on the remote server
@param shellCommand - shellCommand
@param options - {onStdout, onStderr}
@param callback - callback containing following parameters
err - err if exists
code - status code of the ssh process
logs - {stdout: 'stdout logs', stderr: 'stderr logs'}
session.execute(shellCommand, callback);
execute a local shell script in the remote server. You can template shell script with EJS.
@param localScriptFile - localScriptFile
@param options.vars - variables to the template if uses ejs in the script
@param callback - callback containing following parameters
err - err if exists
code - status code of the ssh process
logs - {stdout: 'stdout logs', stderr: 'stderr logs'}
session.executeScript(localScriptFile, options, callback);
copy a file from local machine to the remote machine. Supports binary files too. Support EJS templating with non-binary files
@param localFile - localFile
@param remoteFileLocation - remoteFileLocation
@param options.vars - templateVars
@param optiosn.progressBar - show progress bar
@param callback - callback containing following parameters
err - err if exists
code - status code of the ssh process
logs - {stdout: 'stdout logs', stderr: 'stderr logs'}
session.copy(localFile, remoteFileLocation, options, callback)
FAQs
Server Automation for NodeJS over SSH
The npm package @zodern/nodemiral receives a total of 0 weekly downloads. As such, @zodern/nodemiral popularity was classified as not popular.
We found that @zodern/nodemiral demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.