Browse Source

Make PreferredAuthentications of SSH optional using --sshauth option

pull/5/head
Krishna Srinivas 11 years ago
parent
commit
223b1b1591
  1. 13
      app.js

13
app.js

@ -33,16 +33,21 @@ var opts = require('optimist')
demand: false, demand: false,
description: 'ssh user' description: 'ssh user'
}, },
sshauth: {
demand: false,
description: 'defaults to "password", you can use "publickey,password" instead'
},
port: { port: {
demand: true, demand: true,
alias: 'p', alias: 'p',
description: 'wetty listen port' description: 'wetty listen port'
} },
}).boolean('allow_discovery').argv; }).boolean('allow_discovery').argv;
var runhttps = false; var runhttps = false;
var sshport = 22; var sshport = 22;
var sshhost = 'localhost'; var sshhost = 'localhost';
var sshauth = 'password';
var globalsshuser = ''; var globalsshuser = '';
if (opts.sshport) { if (opts.sshport) {
@ -53,6 +58,10 @@ if (opts.sshhost) {
sshhost = opts.sshhost; sshhost = opts.sshhost;
} }
if (opts.sshauth) {
sshauth = opts.sshauth
}
if (opts.sshuser) { if (opts.sshuser) {
globalsshuser = opts.sshuser; globalsshuser = opts.sshuser;
} }
@ -114,7 +123,7 @@ wss.on('request', function(request) {
rows: 30 rows: 30
}); });
} else { } else {
term = pty.spawn('ssh', [sshuser + sshhost, '-p', sshport, '-o', 'PreferredAuthentications=password'], { term = pty.spawn('ssh', [sshuser + sshhost, '-p', sshport, '-o', 'PreferredAuthentications=' + sshauth], {
name: 'xterm-256color', name: 'xterm-256color',
cols: 80, cols: 80,
rows: 30 rows: 30

Loading…
Cancel
Save