mirror of
				https://git.coolaj86.com/coolaj86/telebit.js.git
				synced 2025-11-03 10:12:46 +00:00 
			
		
		
		
	use default sshd_config on windows also
This commit is contained in:
		
							parent
							
								
									142fb0942c
								
							
						
					
					
						commit
						34bcf79d98
					
				@ -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;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user