Skip to content

Instantly share code, notes, and snippets.

@christopher-baek
Last active November 5, 2023 01:05
Show Gist options
  • Save christopher-baek/1bad551e8c2be53e36a402e6842b3171 to your computer and use it in GitHub Desktop.
Save christopher-baek/1bad551e8c2be53e36a402e6842b3171 to your computer and use it in GitHub Desktop.
Delete System User on Ubuntu
# 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