
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
一款基于node-ssh,它基于ssh2的egg链接ssh的插件。 主要api参考node-ssh
拓展API
class EggSSH extends NodeSSH{
constructor(config:Config)
// 自动连接
autoConnect(config?:Config):Promise<EggSSH>
// 自动连接并执行命令
autoConnectExecCommand(givenCommand: string,
options?:SSHExecCommandOptions,
config?:Config):Promise<SSHExecCommandResponse>
}
$ npm i egg-ssh --save
// {app_root}/config/plugin.js
exports.ssh = {
enable: true,
package: 'egg-ssh',
};
链接配置参考 node-ssh
// {app_root}/config/config.default.js
exports.ssh = {
host: '127.0.0.1',
port: '22',
username: 'root',
password: 'root',
};
see config/config.default.js for more detail.
ssh 会挂载到app上,可以通过this.app.ssh进行api调用
// 例如
// app/controller/home.js
'use strict';
const Controller = require('egg').Controller;
class HomeController extends Controller {
async index() {
const result = await this.app.ssh.autoConnectExecCommand('expr 1 + 1');
this.ctx.body = result.stdout;
}
}
module.exports = HomeController;
Please open an issue here.
FAQs
egg 插件 基于ssh2
We found that egg-ssh 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.