I have tried to run sshpass
command using node.js spawn() to automate ssh. But it automatically exits from the command line without any error.
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);
});