installer: consistent state for initial SSH handling #1750

This commit is contained in:
Franco Fichtner 2017-08-08 22:07:10 +02:00
parent 0692e3ce59
commit de801cefc0
3 changed files with 14 additions and 6 deletions

View File

@ -70,7 +70,8 @@ function filter_core_antilockout_ports()
if ($config['system']['webgui']['protocol'] == "https" && !isset($config['system']['webgui']['disablehttpredirect'])) {
$lockout_ports[] = "80";
}
if (isset($config['system']['ssh']['enabled']) || (!isset($config['system']['ssh']) && is_install_media())) {
if (isset($config['system']['ssh']['enabled']) ||
(is_install_media() && !isset($config['system']['ssh']) && is_process_running('sshd'))) {
$lockout_ports[] = empty($config['system']['ssh']['port']) ? "22" : $config['system']['ssh']['port'];
}
}

View File

@ -31,7 +31,7 @@ require_once('config.inc');
require_once('auth.inc');
require_once('util.inc');
if (!isset($config['system']['ssh']) && is_install_media()) {
if (is_install_media()) {
/*
* Installer mode requires setting up an extra user and
* we will protect it with root's password. We can only
@ -57,8 +57,14 @@ if (!isset($config['system']['ssh']) && is_install_media()) {
local_user_set($root, true);
echo "\n";
echo "Welcome! Both `root' and `installer' users are availabe for system\n";
echo "setup or invoking the installer, respectively. The predefined root\n";
echo "password works for both accounts. Remote login via SSH is possible.\n";
if (!isset($config['system']['ssh']) && is_process_running('sshd')) {
echo "Welcome! Both `root' and `installer' users are availabe for system\n";
echo "setup or invoking the installer, respectively. The predefined root\n";
echo "password works for both accounts. Remote login via SSH is possible.\n";
} else {
echo "Welcome! Both `root' and `installer' users are availabe for system\n";
echo "setup. The predefined root password works for both accounts.\n";
}
}
}

View File

@ -252,7 +252,8 @@ function print_service_banner($service)
}
print_alert_box(
gettext('You are currently running in LiveCD mode. A reboot will reset the configuration.') .' ' .
(is_process_running('sshd') ? gettext('SSH remote login is enabled for the users "root" and ' .
(!isset($config['system']['ssh']) && is_process_running('sshd') ?
gettext('SSH remote login is enabled for the users "root" and ' .
'"installer" using the same password.') : gettext('SSH remote login is disabled.'))
);
default: