跳到主要内容
CNode

如何使用node执行远程linux服务器命令

社区
Aagilekd发布于 14 年前最后回复 14 年前
4102810

RT。听说用Java能使用SSH+SCP实现在代码中直接执行远程linux命令,node 有没有类似的功能,或者工具?

查看回复

回复 (4)

Y
yansong#314 年前

firstly, google:ssh login without password. get the result and try

A
agilekd#214 年前

ssh user@host 'ls' 并不是马上返回结果,而是要求输入密码 有没有一种方法,是预先建立好连接,通过验证。后面每次发送命令都可以直接执行?

J
jiyinyiyong#114 年前

直接调用 Sholl 命令行不?

{exec} = require "child_process"
exec "ssh [email protected] 'ls'"

参与回复

登录后即可参与回复。登录