From 2d402f570b4925fe8c44218bdf72de1878704d17 Mon Sep 17 00:00:00 2001 From: jim-p Date: Mon, 21 Jun 2010 11:13:30 -0400 Subject: Do a more thorough check for missing sshd key files. Should fix #673 --- etc/sshd | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'etc/sshd') diff --git a/etc/sshd b/etc/sshd index a700615..2a61afc 100755 --- a/etc/sshd +++ b/etc/sshd @@ -135,7 +135,14 @@ exit; } - if (!file_exists("$sshConfigDir/ssh_host_key")) { + // Check for all needed key files. If any are missing, the keys need to be regenerated. + $generate_keys = false; + foreach ($files_to_check as $f2c) { + if (!file_exists($f2c)) { + $generate_keys = true; + } + } + if ($generate_keys) { /* remove previous keys and regen later */ file_notice("SSH", "{$g['product_name']} has started creating your SSH keys. SSH Startup will be delayed. Please note that reloading the filter rules and changes will be delayed until this operation is completed.", "SSH KeyGen", ""); mwexec("rm /etc/ssh/ssh_host_*", true); -- cgit v1.1