From d6b02f6e3619de39a77403e4bb1bb684ee5ce3c3 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 (cherry picked from commit 6e0b146ed3b90da577c3ecba38836883fd435e7a) --- 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 30e823bd4..cff0c5039 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