Skip to content

Commit

Permalink
shell example, should work soon
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed Mar 20, 2011
1 parent 04c60cd commit 013aa3e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions examples/shell.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
var ssh = require('ssh');
var repl = require('repl');

ssh.createServer(function (session) {
session.on('password', function (user, pass, cb) {
cb(user === 'foo' && pass === 'bar');
});

session.on('shell', function (sh) {
repl.start('node-ssh $ ', sh);
});
});

0 comments on commit 013aa3e

Please sign in to comment.