summaryrefslogtreecommitdiffstats
path: root/etc/sshd
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-07-24 21:38:46 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-07-24 21:38:46 +0000
commit426f300c72ae411c0ad509b5016e5efdc52cd06b (patch)
treeb66c21ca86aee7d2a843cfa362d20d9f5dd663ee /etc/sshd
parent0ae71d819b9c0656a054106aad0e8f978454fea0 (diff)
downloadpfsense-426f300c72ae411c0ad509b5016e5efdc52cd06b.zip
pfsense-426f300c72ae411c0ad509b5016e5efdc52cd06b.tar.gz
Check for key existance before clearing out
Diffstat (limited to 'etc/sshd')
-rwxr-xr-xetc/sshd18
1 files changed, 10 insertions, 8 deletions
diff --git a/etc/sshd b/etc/sshd
index 2bee72f..bb67d95 100755
--- a/etc/sshd
+++ b/etc/sshd
@@ -70,14 +70,16 @@
$sshConfigDir = "/etc/ssh";
- unset($config['ssh']['dsa_key']);
- unset($config['ssh']['rsa_key']);
- unset($config['ssh']['rsa1_key']);
- unset($config['ssh']['dsa']);
- unset($config['ssh']['rsa']);
- unset($config['ssh']['rsa1']);
- unset($config['ssh']['ak']);
- write_config("Clearing SSH keys from config.xml");
+ if($config['ssh']['dsa_key'] <> "") {
+ unset($config['ssh']['dsa_key']);
+ unset($config['ssh']['rsa_key']);
+ unset($config['ssh']['rsa1_key']);
+ unset($config['ssh']['dsa']);
+ unset($config['ssh']['rsa']);
+ unset($config['ssh']['rsa1']);
+ unset($config['ssh']['ak']);
+ write_config("Clearing SSH keys from config.xml");
+ }
//if (!file_exists("$sshConfigDir/ssh_host_key") and $config['ssh']['dsa'] == "") {
if (!file_exists("$sshConfigDir/ssh_host_key")) {
OpenPOWER on IntegriCloud