This commit is contained in:
Jamie Cameron
2023-04-14 15:39:09 -07:00
parent 0cc62bf748
commit 91a20d4b08
2 changed files with 5 additions and 8 deletions

View File

@@ -56,22 +56,19 @@ else {
# Allow logins by root
$root = &find_value("PermitRootLogin", $conf);
if (!$root) {
# Default ways seems to be 'yes'
$root = "yes";
}
@opts = ( [ 'yes', $text{'yes'} ],
@opts = ( [ '', $text{'default'}.' ('.$text{'users_nopwd'}.')' ],
[ 'yes', $text{'yes'} ],
[ 'no', $text{'no'} ] );
if ($version{'type'} eq 'ssh') {
push(@opts, [ 'nopwd', $text{'users_nopwd'} ]);
}
else {
push(@opts, [ 'without-password', $text{'users_nopwd'} ]);
push(@opts, [ 'prohibit-password', $text{'users_nopwd'} ]);
if ($version{'number'} >= 2) {
push(@opts, [ 'forced-commands-only', $text{'users_fcmd'} ]);
}
}
print "</select></td>\n";
$root = "prohibit-password" if ($root eq "without-password");
print &ui_table_row($text{'users_root'},
&ui_select("root", lc($root), \@opts));

View File

@@ -45,7 +45,7 @@ if ($version{'type'} ne 'ssh' || $version{'number'} < 3) {
&save_directive("PermitEmptyPasswords", $conf, $in{'pempty'} ? 'yes' : 'no');
&save_directive("PermitRootLogin", $conf, $in{'root'});
&save_directive("PermitRootLogin", $conf, $in{'root'} || undef);
if (($version{'type'} eq 'ssh' && $version{'number'} < 3) ||
($version{'type'} eq 'openssh' && $version{'number'} < 7.3)) {