. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ ##|+PRIV ##|*IDENT=page-system-advanced-admin ##|*NAME=System: Advanced: Admin Access Page ##|*DESCR=Allow access to the 'System: Advanced: Admin Access' page. ##|*MATCH=system_advanced_admin.php* ##|-PRIV require("guiconfig.inc"); $pconfig['cert'] = base64_decode($config['system']['webgui']['certificate']); $pconfig['key'] = base64_decode($config['system']['webgui']['private-key']); $pconfig['disableconsolemenu'] = isset($config['system']['disableconsolemenu']); $pconfig['noantilockout'] = isset($config['system']['webgui']['noantilockout']); $pconfig['enableserial'] = $config['system']['enableserial']; $pconfig['enablesshd'] = $config['system']['enablesshd']; $pconfig['sshport'] = $config['system']['ssh']['port']; $pconfig['sshdkeyonly'] = $config['system']['ssh']['sshdkeyonly']; $pconfig['authorizedkeys'] = base64_decode($config['system']['ssh']['authorizedkeys']); if ($_POST) { unset($input_errors); $pconfig = $_POST; /* input validation */ if (($_POST['cert'] && !$_POST['key']) || ($_POST['key'] && !$_POST['cert'])) $input_errors[] = "Certificate and key must always be specified together."; if ($_POST['cert'] && $_POST['key']) { if (!strstr($_POST['cert'], "BEGIN CERTIFICATE") || !strstr($_POST['cert'], "END CERTIFICATE")) $input_errors[] = "This certificate does not appear to be valid."; if (!strstr($_POST['key'], "BEGIN RSA PRIVATE KEY") || !strstr($_POST['key'], "END RSA PRIVATE KEY")) $input_errors[] = "This key does not appear to be valid."; } if ($_POST['sshport']) if(!is_port($_POST['sshport'])) $input_errors[] = "You must specify a valid port number"; if($_POST['sshdkeyonly'] == "yes") $config['system']['ssh']['sshdkeyonly'] = "enabled"; else unset($config['system']['ssh']['sshdkeyonly']); ob_flush(); flush(); if (!$input_errors) { $oldcert = $config['system']['webgui']['certificate']; $oldkey = $config['system']['webgui']['private-key']; $config['system']['webgui']['certificate'] = base64_encode($_POST['cert']); $config['system']['webgui']['private-key'] = base64_encode($_POST['key']); if($_POST['disableconsolemenu'] == "yes") { $config['system']['disableconsolemenu'] = true; auto_login(true); } else { unset($config['system']['disableconsolemenu']); auto_login(false); } if ($_POST['noantilockout'] == "yes") $config['system']['webgui']['noantilockout'] = true; else unset($config['system']['webgui']['noantilockout']); if ($_POST['enableserial'] == "yes") $config['system']['enableserial'] = true; else unset($config['system']['enableserial']); if($_POST['enablesshd'] == "yes") { $config['system']['enablesshd'] = "enabled"; touch("{$g['tmp_path']}/start_sshd"); } else { unset($config['system']['enablesshd']); mwexec("/usr/bin/killall sshd"); } $oldsshport = $config['system']['ssh']['port']; if ($_POST['sshdkeyonly'] == "yes") { $config['system']['sshdkeyonly'] = true; touch("{$g['tmp_path']}/start_sshd"); } else { unset($config['system']['sshdkeyonly']); mwexec("/usr/bin/killall sshd"); } $config['system']['ssh']['port'] = $_POST['sshport']; $config['system']['ssh']['authorizedkeys'] = base64_encode($_POST['authorizedkeys']); write_config(); config_lock(); $retval = filter_configure(); if(stristr($retval, "error") <> true) $savemsg = get_std_save_message($retval); else $savemsg = $retval; config_unlock(); conf_mount_rw(); setup_serial_port(); conf_mount_ro(); } } $pgtitle = array("System","Advanced: Admin Access"); include("head.inc"); ?>
Note: the options on this page are intended for use by advanced users only.

webConfigurator
Certificate
Paste a signed certificate in X.509 PEM format here. Create certificates automatically.
Key
Paste an RSA private key in PEM format here.
Anti-lockout /> Disable webConfigurator anti-lockout rule
By default, access to the webConfigurator on the interface is always permitted, regardless of the user-defined filter rule set. Enable this feature to control webConfigurator access (make sure to have a filter rule in place that allows you in, or you will lock yourself out!). Hint: the "set configure IP address" option in the console menu resets this setting as well.
 
Secure Shell
Secure Shell Server /> Enable Secure Shell
Authentication Method /> Disable Password login for Secure Shell (rsa key only)
When this option is enabled, you will need to configure allowed keys for each user that has secure shell access.
SSH port
Note: Leave this blank for the default of 22

Paste an authorized keys file here.
 
Serial Communcations
Serial Terminal /> This will enable the first serial port with 9600/8/N/1
Note: This will disable the internal video card/keyboard
 
Shell Options
Console menu /> Password protect the console menu
Changes to this option will take effect after a reboot.