diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..ee9fc3d8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +# Don't check in SSH keys! +*.pem + +# Various directories +logs/ +db/ +dropfiles/ +node_modules/ \ No newline at end of file diff --git a/core/config.js b/core/config.js index 35cb0c92..65311dab 100644 --- a/core/config.js +++ b/core/config.js @@ -132,8 +132,17 @@ function getDefaultConfig() { ssh : { port : 8889, enabled : true, - rsaPrivateKey : paths.join(__dirname, './../misc/default_key.rsa'), - dsaPrivateKey : paths.join(__dirname, './../misc/default_key.dsa'), + + // + // Private key in PEM format + // + // Generating your PK: + // > openssl genrsa -des3 -out ./misc/ssh_private_key.pem 2048 + // + // Then, set servers.ssh.privateKeyPass to the password you use above + // in your config.hjson + // + privateKeyPem : paths.join(__dirname, './../misc/ssh_private_key.pem'), firstMenu : 'sshConnected', firstMenuNewUser : 'sshConnectedNewUser', } diff --git a/core/servers/ssh.js b/core/servers/ssh.js index 2553c9ae..44956845 100644 --- a/core/servers/ssh.js +++ b/core/servers/ssh.js @@ -25,13 +25,6 @@ exports.moduleInfo = { exports.getModule = SSHServerModule; -/* - TODO's - * Need to handle new user path - => [ new username(s) ] -> apply path -> - => "new" or "apply" -> .... -*/ - function SSHClient(clientConn) { baseClient.Client.apply(this, arguments); @@ -239,7 +232,8 @@ SSHServerModule.prototype.createServer = function() { SSHServerModule.super_.prototype.createServer.call(this); var serverConf = { - privateKey : fs.readFileSync(Config.servers.ssh.rsaPrivateKey), + privateKey : fs.readFileSync(Config.servers.ssh.privateKeyPem), + passphrase : Config.servers.ssh.privateKeyPass, ident : 'enigma-bbs-' + enigVersion + '-srv', // Note that sending 'banner' breaks at least EtherTerm! debug : function debugSsh(dbgLine) {