From 6e0b146ed3b90da577c3ecba38836883fd435e7a Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Fri, 16 Feb 2024 12:52:36 +0100 Subject: login: T5972: add possibility to disable individual local user accounts * set system login user disable --- src/conf_mode/system_login.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/conf_mode/system_login.py') diff --git a/src/conf_mode/system_login.py b/src/conf_mode/system_login.py index 3d16bdb4a..49306c894 100755 --- a/src/conf_mode/system_login.py +++ b/src/conf_mode/system_login.py @@ -367,6 +367,12 @@ def apply(login): if os.path.exists(f'{home_dir}/.google_authenticator'): os.remove(f'{home_dir}/.google_authenticator') + # Lock/Unlock local user account + lock_unlock = '--unlock' + if 'disable' in user_config: + lock_unlock = '--lock' + cmd(f'usermod {lock_unlock} {user}') + if 'rm_users' in login: for user in login['rm_users']: try: -- cgit v1.2.3