summaryrefslogtreecommitdiff
path: root/src/conf_mode/system_login.py
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-02-16 12:52:36 +0100
committerChristian Breunig <christian@breunig.cc>2024-02-16 15:51:47 +0100
commit6e0b146ed3b90da577c3ecba38836883fd435e7a (patch)
tree0665d10a1a81acc5aff22d287c978e7bc4acd870 /src/conf_mode/system_login.py
parent71497e76c9cf0724581505f50e8b78b6e1c47316 (diff)
downloadvyos-1x-6e0b146ed3b90da577c3ecba38836883fd435e7a.tar.gz
vyos-1x-6e0b146ed3b90da577c3ecba38836883fd435e7a.zip
login: T5972: add possibility to disable individual local user accounts
* set system login user <name> disable
Diffstat (limited to 'src/conf_mode/system_login.py')
-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: