Browse Source

allways use ssh and never /bin/login;

pull/40/head
Tino Rusch 9 years ago
parent
commit
99dfb3d2d2
  1. 20
      app.js

20
app.js

@ -117,19 +117,13 @@ io.on('connection', function(socket){
}
var term;
if (process.getuid() === 0) {
term = pty.spawn('/bin/login', [], {
name: 'xterm-256color',
cols: 80,
rows: 30
});
} else {
term = pty.spawn('ssh', [sshuser + sshhost, '-p', sshport, '-o', 'PreferredAuthentications=' + sshauth], {
name: 'xterm-256color',
cols: 80,
rows: 30
});
}
term = pty.spawn('ssh', [sshuser + sshhost, '-p', sshport, '-o', 'PreferredAuthentications=' + sshauth], {
name: 'xterm-256color',
cols: 80,
rows: 30
});
console.log((new Date()) + " PID=" + term.pid + " STARTED on behalf of user=" + sshuser);
term.on('data', function(data) {
socket.emit('output', data);

Loading…
Cancel
Save