4

我尝试sshpass使用 node.js spawn() 运行命令来自动化 ssh。但它会自动从命令行退出而没有任何错误。这是我使用的代码。

var tail = spawn("sshpass", ["-p", "test", "ssh", "-n", "test@xxx.x.xxx.xxx", "'cat testfile'"]);
tail.stdout.on("data", function(data) {
        readData(data);
});
4

0 回答 0