summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-07-31 01:15:32 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-07-31 01:15:32 +0000
commit36aaefff61f6107126912d4038a7d2cf1cb49c09 (patch)
treeff2853eaff6bbd65dd712c10aad62199c5353432
parent3d941d72333ae7a4451f3e39e150029aa6f4794d (diff)
downloadpfsense-36aaefff61f6107126912d4038a7d2cf1cb49c09.zip
pfsense-36aaefff61f6107126912d4038a7d2cf1cb49c09.tar.gz
Allow SSH service to be disabled / enabled.
-rw-r--r--cf/conf/config.xml1
-rw-r--r--conf.default/config.xml1
-rwxr-xr-xetc/sshd3
-rwxr-xr-xusr/local/www/system_advanced.php27
4 files changed, 31 insertions, 1 deletions
diff --git a/cf/conf/config.xml b/cf/conf/config.xml
index 8bb1b03..a17cc8d 100644
--- a/cf/conf/config.xml
+++ b/cf/conf/config.xml
@@ -5,6 +5,7 @@
<lastchange></lastchange>
<theme>metallic</theme>
<system>
+ <enablesshd/>
<optimization>normal</optimization>
<schedulertype>priq</schedulertype>
<hostname>pfSense</hostname>
diff --git a/conf.default/config.xml b/conf.default/config.xml
index 5c773d1..07510c0 100644
--- a/conf.default/config.xml
+++ b/conf.default/config.xml
@@ -5,6 +5,7 @@
<lastchange></lastchange>
<theme>metallic</theme>
<system>
+ <enablesshd/>
<optimization>normal</optimization>
<schedulertype>priq</schedulertype>
<hostname>pfSense</hostname>
diff --git a/etc/sshd b/etc/sshd
index bb67d95..4a5c71c 100755
--- a/etc/sshd
+++ b/etc/sshd
@@ -32,6 +32,9 @@
$stderr = fopen("php://stderr", "w");
+ if(!isset($config['sshenabled']))
+ exit;
+
function file_size($file) {
$size = filesize($file);
return $size;
diff --git a/usr/local/www/system_advanced.php b/usr/local/www/system_advanced.php
index 117fb43..f7e4fe8 100755
--- a/usr/local/www/system_advanced.php
+++ b/usr/local/www/system_advanced.php
@@ -52,6 +52,7 @@ $pconfig['disablerendevouz'] = $config['system']['disablerendevouz'];
$pconfig['enableserial'] = $config['system']['enableserial'];
$pconfig['disablefirmwarecheck'] = isset($config['system']['disablefirmwarecheck']);
$pconfig['preferoldsa_enable'] = isset($config['ipsec']['preferoldsa']);
+$pconfig['sshenabled'] = $config['system']['sshenabled'];
if ($_POST) {
@@ -90,6 +91,11 @@ if ($_POST) {
} else {
unset($config['system']['disablefilter']);
}
+ if($_POST['sshenabled'] == "yes") {
+ $config['system']['sshenabled'] = "enabled";
+ } else {
+ unset($config['system']['sshenabled']);
+ }
if($_POST['disableftpproxy'] == "yes") {
$config['system']['disableftpproxy'] = "enabled";
unset($config['system']['rfc959workaround']);
@@ -272,7 +278,26 @@ function openwindow(url) {
</tr>
<?php endif ?>
-
+ <tr>
+ <td colspan="2" valign="top" class="listtopic">Secure Shell</td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">&nbsp;</td>
+ <td width="78%" class="vtable">
+ <input name="sshenable" type="checkbox" id="sshenable" value="yes" <?php if (isset($pconfig['sshenable'])) echo "checked"; ?> onclick="enable_change(false)">
+ <strong>This controls if SSH is enabled</strong>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top">&nbsp;</td>
+ <td width="78%">
+ <input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)">
+ </td>
+ </tr>
+ </tr>
+ <tr>
+ <td colspan="2" class="list" height="12"></td>
+ </tr>
<tr>
<td colspan="2" valign="top" class="listtopic">Theme</td>
OpenPOWER on IntegriCloud