From 34bcf79d98194c8cd31c6a44adc5a521d1e8c1d3 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Thu, 1 Nov 2018 00:56:39 -0600 Subject: [PATCH] use default sshd_config on windows also --- lib/ssh.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/ssh.js b/lib/ssh.js index 3097023..8d761ab 100644 --- a/lib/ssh.js +++ b/lib/ssh.js @@ -42,9 +42,13 @@ function sshAllowsPassword(user) { module.exports.checkSecurity = function () { var conf = {}; - var sshdConf = '/etc/ssh/sshd_config'; var noRootPasswordRe = /(?:^|[\r\n]+)\s*PermitRootLogin\s+(prohibit-password|without-password|no)\s*/i; var noPasswordRe = /(?:^|[\r\n]+)\s*PasswordAuthentication\s+(no)\s*/i; + var sshdConf = '/etc/ssh/sshd_config'; + if (/^win/i.test(process.platform)) { + // TODO use %PROGRAMDATA%\ssh\sshd_config + sshdConf = 'C:\\ProgramData\\ssh\\sshd_config'; + } return readFile(sshdConf, null).then(function (sshd) { sshd = sshd.toString('utf8'); var match;