summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorSeth Mos <seth.mos@xs4all.nl>2005-10-13 20:41:56 +0000
committerSeth Mos <seth.mos@xs4all.nl>2005-10-13 20:41:56 +0000
commit74806ceecee77e0327f94432b61ecd7839502a81 (patch)
tree6bbc919aa18f98e87f2551a4f2e8c60ba1d03e19 /usr
parent28b58598bc6f4a31d5ebf96f6bdd1ead8808eced (diff)
downloadpfsense-74806ceecee77e0327f94432b61ecd7839502a81.zip
pfsense-74806ceecee77e0327f94432b61ecd7839502a81.tar.gz
Allow running of ssh on alternate port
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/www/system_advanced.php21
1 files changed, 19 insertions, 2 deletions
diff --git a/usr/local/www/system_advanced.php b/usr/local/www/system_advanced.php
index 0a2993b..5fe3e45 100755
--- a/usr/local/www/system_advanced.php
+++ b/usr/local/www/system_advanced.php
@@ -53,6 +53,7 @@ $pconfig['enableserial'] = $config['system']['enableserial'];
$pconfig['disablefirmwarecheck'] = isset($config['system']['disablefirmwarecheck']);
$pconfig['preferoldsa_enable'] = isset($config['ipsec']['preferoldsa']);
$pconfig['enablesshd'] = $config['system']['enablesshd'];
+$pconfig['sshport'] = $config['system']['ssh']['port'];
$pconfig['sharednet'] = $config['system']['sharednet'];
if ($_POST) {
@@ -90,7 +91,12 @@ if ($_POST) {
if ($_POST['maximumstates'] > 100000000)
$input_errors[] = "States must be above 1000 and below 100000000";
}
-
+ if ($_POST['sshport'] <> "") {
+ if( ! is_port($_POST['sshport'])) {
+ $input_errors[] = "You must specify a valid port number";
+ }
+ }
+
if (!$input_errors) {
if($_POST['disablefilter'] == "yes") {
$config['system']['disablefilter'] = "enabled";
@@ -102,6 +108,8 @@ if ($_POST) {
} else {
unset($config['system']['enablesshd']);
}
+ $oldsshport = $config['system']['ssh']['port'];
+ $config['system']['ssh']['port'] = $_POST['sshport'];
if($_POST['sharednet'] == "yes") {
$config['system']['sharednet'] = true;
@@ -217,7 +225,8 @@ if ($_POST) {
fclose($fout);
}
- mwexec("/etc/sshd");
+ $ssh_output = mwexec("/etc/sshd");
+ log_error("restarting sshd, $ssh_output");
conf_mount_ro();
}
@@ -273,6 +282,14 @@ include("head.inc");
</td>
</tr>
<tr>
+ <td width="22%" valign="top" class="vncell">SSH port</td>
+ <td width="78%" class="vtable">
+ <input name="sshport" type="text" id="sshport" value="<?php echo $pconfig['sshport']; ?>" onclick="enable_change(false)" />
+ <br />
+ <span class="vexpl">Note: Leave this blank for the default of 22</span>
+ </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)" />
OpenPOWER on IntegriCloud