diff options
author | Christian Poessinger <christian@poessinger.com> | 2022-04-04 22:21:25 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2022-04-04 22:21:25 +0200 |
commit | efa753bc661d04967237e7ec3d72d3757230aaf9 (patch) | |
tree | 043eddd78dabb1169bf860748cb8ada518db88a9 /src/conf_mode | |
parent | 4bb0adf535e12dc962a0ebea0f5a96f612a76a5d (diff) | |
download | vyos-1x-efa753bc661d04967237e7ec3d72d3757230aaf9.tar.gz vyos-1x-efa753bc661d04967237e7ec3d72d3757230aaf9.zip |
login: T4341: disable user account prior to deletion
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-x | src/conf_mode/system-login.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/conf_mode/system-login.py b/src/conf_mode/system-login.py index 4dd7f936d..9b8f194fb 100755 --- a/src/conf_mode/system-login.py +++ b/src/conf_mode/system-login.py @@ -250,6 +250,9 @@ def apply(login): if 'rm_users' in login: for user in login['rm_users']: try: + # Disable user to prevent re-login + call(f'usermod -s /sbin/nologin {user}') + # Logout user if he is still logged in if user in list(set([tmp[0] for tmp in users()])): print(f'{user} is logged in, forcing logout!') |