summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xetc/sshd9
1 files changed, 8 insertions, 1 deletions
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);
OpenPOWER on IntegriCloud