这就是我目前正在运行的:
const spawn = require('child_process').spawn;
const connect = spawn('ssh', ['-T', '-i', '/keys/key.pem', 'ec2-user@00.000.000.000']);
connect.stdout.on('data', function(data) {
console.log(`stdout: ${data}`);
});
connect.stderr.on('data', (data) => {
console.log(`stderr: ${data}`);
});
connect.on('close', (code) => {
console.log(`child process exited with code ${code}`);
});
(我的IP地址实际上不是00.000.000.000)
我收到错误:
stderr: ssh: connect to host 00.000.000.000 port 22: Operation timed out