Security News
Combatting Alert Fatigue by Prioritizing Malicious Intent
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
HuSSH is a simple wrapper for ssh2 with only a few simple features:
If you need anything more complex than file upload/download and command execution, use ssh2 directly. If you don't need/want very simplified commands, use ssh2.
var hussh = require("hussh")
var client = hussh({
host: "example.com",
username: "foo",
privateKey: require("fs").readFileSync("./my-secret.key")
}, {encoding: "utf-8"});
// upload a string to a remote file
client.uploadString("text for my file", "remote-file.txt", function(err){
if ( ! err ) {
// file contents uploaded
}
});
// execute a command and save all buffered output
client.execBuffer("env", {MYENVVAR: "myenv-value"}, function(err, result){
if ( ! err ) {
// command exit status is 0, access result.stdout and result.stderr here
}
else {
// command had non-zero exit status... see what happened
console.error(err.message)
}
});
var client = hussh(sshOptions, moreOptions);
client.exec(command, env, callback);
client.execBuffer(command, env, callback);
client.execStatus(command, env, callback);
client.uploadString(stringData, remoteFile, callback);
client.upload(localFile, remoteFile, callback);
client.download(remoteFile, localFile, callback);
These are all just shortcuts which create an SFTP session, handle streams, and call the callback (receives Error on failure).
FAQs
SSH2 wrapper
We found that hussh 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
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.