summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-02-16 12:52:36 +0100
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2024-02-17 08:59:10 +0000
commitd6b02f6e3619de39a77403e4bb1bb684ee5ce3c3 (patch)
tree9855cfddd24d2e147814cc6c28f164159cfda0e6 /src/conf_mode
parentdb8b115301d5476151e7d0910ba674a683683122 (diff)
downloadvyos-1x-d6b02f6e3619de39a77403e4bb1bb684ee5ce3c3.tar.gz
vyos-1x-d6b02f6e3619de39a77403e4bb1bb684ee5ce3c3.zip
login: T5972: add possibility to disable individual local user accounts
* set system login user <name> disable (cherry picked from commit 6e0b146ed3b90da577c3ecba38836883fd435e7a)
Diffstat (limited to 'src/conf_mode')
-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: