Skip to content

Commit

Permalink
openssh: do not allow sftp login for non-admins
Browse files Browse the repository at this point in the history
Also suggested by @fabianfrz.  Not perfect yet as we seem
to mix wheel with access and either need to lock down shell
access along with it or somehow tag along the shell privilege.

Small race in the group setting on the user page.

PR: https://forum.opnsense.org/index.php?topic=6994.0
  • Loading branch information
fichtner committed Jan 27, 2018
1 parent 1fbbece commit 2fc86a7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/etc/inc/plugins.inc.d/openssh.inc
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ function openssh_configure_do($verbose = false, $interface = '')
$sshconf .= "UseDNS no\n";
$sshconf .= "X11Forwarding no\n";
$sshconf .= "PubkeyAuthentication yes\n";
$sshconf .= "Subsystem\tsftp\tinternal-sftp\n";
$sshconf .= "Subsystem sftp internal-sftp\n";
$sshconf .= "AllowGroups wheel\n";
if (isset($sshcfg['permitrootlogin'])) {
$sshconf .= "PermitRootLogin yes\n";
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/www/system_usermanager.php
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,8 @@ function get_user_privdesc(& $user)
$a_user[] = $userent;
}

local_user_set($userent);
local_user_set_groups($userent, $pconfig['groups']);
local_user_set($userent);
write_config();

if (!empty($pconfig['chkNewCert'])) {
Expand Down

0 comments on commit 2fc86a7

Please sign in to comment.