summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2024-02-17 19:10:58 -0600
committerGitHub <noreply@github.com>2024-02-17 19:10:58 -0600
commit3230d09c292c89eddd34e33fda9570042e92e1fd (patch)
treee07054babc9379e70cc8e49432b4f01f3dc36d08 /src
parent64f5195abb899b9dc9ce9d7b96c59d5faabf6c0a (diff)
parentd6b02f6e3619de39a77403e4bb1bb684ee5ce3c3 (diff)
downloadvyos-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')
-rwxr-xr-xsrc/conf_mode/system_login.py6
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: