mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-07-29 12:09:37 +00:00
ssh: Add sudo to allowed groups
This is to allow vagrant user to login, as well as a normal sudo user that was created before installing FreedomBox. For most FreedomBoxes, the sudo group is empty, so it will have no impact. I do not update the existing file. But if someone needs this update, they can disable and then re-enable the restrict option. Signed-off-by: James Valleroy <jvalleroy@mailbox.org> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
parent
695138d4d6
commit
09d8ee1b8e
@ -58,11 +58,11 @@ def setup():
|
||||
|
||||
@privileged
|
||||
def restrict_users(should_restrict: bool):
|
||||
"""Restrict SSH logins to groups root, admin and freedombox-ssh."""
|
||||
"""Restrict SSH logins to groups root, sudo, admin and freedombox-ssh."""
|
||||
if not should_restrict:
|
||||
config_file.unlink(missing_ok=True)
|
||||
else:
|
||||
config_file.write_text('AllowGroups root admin freedombox-ssh\n',
|
||||
config_file.write_text('AllowGroups root sudo admin freedombox-ssh\n',
|
||||
encoding='utf-8')
|
||||
|
||||
action_utils.service_reload('sshd')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user