diff options
author | John Estabrook <jestabro@vyos.io> | 2024-02-17 19:10:58 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-17 19:10:58 -0600 |
commit | 3230d09c292c89eddd34e33fda9570042e92e1fd (patch) | |
tree | e07054babc9379e70cc8e49432b4f01f3dc36d08 /src/conf_mode | |
parent | 64f5195abb899b9dc9ce9d7b96c59d5faabf6c0a (diff) | |
parent | d6b02f6e3619de39a77403e4bb1bb684ee5ce3c3 (diff) | |
download | vyos-1x-3230d09c292c89eddd34e33fda9570042e92e1fd.tar.gz vyos-1x-3230d09c292c89eddd34e33fda9570042e92e1fd.zip |
Merge pull request #3023 from vyos/mergify/bp/sagitta/pr-3019
login: T5972: add possibility to disable individual local user accounts (backport #3019)
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-x | src/conf_mode/system_login.py | 6 |
1 files changed, 6 insertions, 0 deletions
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: |