Files
bigwo/mcp-server-ssh/check_greeting3.cjs

12 lines
469 B
JavaScript

const { Client } = require('ssh2');
const c = new Client();
c.on('ready', () => {
c.exec('grep "mmsuckxe" /var/log/bigwo/server-out.log | head -60', (err, s) => {
if (err) { console.error(err); c.end(); return; }
let o = '';
s.on('data', (d) => (o += d));
s.stderr.on('data', (d) => (o += d));
s.on('close', () => { console.log(o); c.end(); });
});
}).connect({ host: '119.45.10.34', port: 22, username: 'root', password: '#xyzh%CS#2512@28' });