summaryrefslogtreecommitdiffstats
path: root/etc/sshd
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-07-09 17:43:28 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-07-09 17:43:28 +0000
commitc2338828631f26927ad13683470bdae8ead975fd (patch)
tree9d4e77a25401220ec86c98d049ef7d19037cee64 /etc/sshd
parent9c704188010c2efe706d32fa2bfe71115c971941 (diff)
downloadpfsense-c2338828631f26927ad13683470bdae8ead975fd.zip
pfsense-c2338828631f26927ad13683470bdae8ead975fd.tar.gz
If keys exist and they are not stored in config.xml, remove the keys and regen and then store them in config.xml
Diffstat (limited to 'etc/sshd')
-rwxr-xr-xetc/sshd5
1 files changed, 5 insertions, 0 deletions
diff --git a/etc/sshd b/etc/sshd
index 7ed4666..aeb94f5 100755
--- a/etc/sshd
+++ b/etc/sshd
@@ -53,6 +53,11 @@
pclose($fd);
$sshConfigDir = "/etc/ssh";
+
+ if (!file_exists("$sshConfigDir/ssh_host_key") and $config['ssh']['dsa'] == "") {
+ /* remove previous keys and regen later */
+ mwexec("rm /etc/ssh/ssh_host_*");
+ }
if (!file_exists("$sshConfigDir/ssh_host_key") and $config['ssh']['dsa'] == "") {
/* generate keys */
OpenPOWER on IntegriCloud