Skip to content

Commit

Permalink
support for triton ssh user@id
Browse files Browse the repository at this point in the history
  • Loading branch information
bahamas10 committed Sep 1, 2015
1 parent 333c47a commit c4f85db
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/do_ssh.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ function do_ssh(subcmd, opts, args, callback) {
}

var id = args.shift();

var user = 'root';
var i = id.indexOf('@');
if (i >= 0) {
user = id.substr(0, i);
id = id.substr(i + 1);
}

this.triton.getInstance(id, function (err, inst) {
if (err) {
callback(err);
Expand All @@ -31,7 +39,7 @@ function do_ssh(subcmd, opts, args, callback) {
return;
}

args = ['-l', 'root'].concat(ip).concat(args);
args = ['-l', user].concat(ip).concat(args);

self.triton.log.info({args: args}, 'forking ssh');
var child = spawn('ssh', args, {stdio: 'inherit'});
Expand Down

0 comments on commit c4f85db

Please sign in to comment.