I have tried to run sshpass command using node.js spawn() to automate ssh. But it automatically exists from the command line. this is the code I used.
var tail = spawn("sshpass", ["-p", "test", "ssh", "-n", "test@xxx.x.xxx.xxx", "'cat testfile'"]);
tail.stdout.on("data", function(data) {
readData(data);
});
Aucun commentaire:
Enregistrer un commentaire