summaryrefslogtreecommitdiffstats
path: root/etc/sshd
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2010-06-21 11:13:30 -0400
committerjim-p <jimp@pfsense.org>2010-06-21 11:13:30 -0400
commit2d402f570b4925fe8c44218bdf72de1878704d17 (patch)
treeb644689f845043dac9b5356f44d55b1ed7225c5b /etc/sshd
parentbf02c78434cb5b3b5bec7a8c5b70ee12001641b7 (diff)
downloadpfsense-2d402f570b4925fe8c44218bdf72de1878704d17.zip
pfsense-2d402f570b4925fe8c44218bdf72de1878704d17.tar.gz
Do a more thorough check for missing sshd key files. Should fix #673
Diffstat (limited to 'etc/sshd')
-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