summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-02-17 09:42:49 +0100
committerGitHub <noreply@github.com>2024-02-17 09:42:49 +0100
commitab5f98bd469ce7aadf8483b968b9f9f9e82a9812 (patch)
treef0dbef727463a6687c41b0638e69f1001d88492f /src
parent52aff3b997129dba5dfcfe1c5cbce41e4ee7b50b (diff)
parent6e0b146ed3b90da577c3ecba38836883fd435e7a (diff)
downloadvyos-1x-ab5f98bd469ce7aadf8483b968b9f9f9e82a9812.tar.gz
vyos-1x-ab5f98bd469ce7aadf8483b968b9f9f9e82a9812.zip
Merge pull request #3019 from c-po/login-T5972
login: T5972: add possibility to disable individual local user accounts
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 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: