Last active
November 5, 2023 01:05
-
-
Save christopher-baek/1bad551e8c2be53e36a402e6842b3171 to your computer and use it in GitHub Desktop.
Delete System User on Ubuntu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Delete System User on Ubuntu | |
**kill active sessions** | |
``` | |
sudo loginctl disable-linger [USER] | |
sudo loginctl terminate-user [USER] | |
``` | |
**delete user and remove home directory** | |
``` | |
sudo deluser --remove-home [USER] | |
``` | |
**delete user and remove all files owned by user** | |
This will traverse the entire system, so double check mounted filesystems before running this. | |
``` | |
sudo deluser --remove-all-files [USER] | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment