How to delete a user Linux (Ubuntu | Debian | Centos) CLI

This is a quick reference guide on how to delete a user on Linux Based Operating Systems.

Delete a user.

root@VPS:~# userdel vpsuser

Delete the users home directory and mail spool.

root@VPS:~# deluser vpsuser --remove-home
Looking for files to backup/remove ...
Removing files ...
Removing user `vpsuser' ...
Warning: group `vpsuser' has no more members.
Done.

Delete all user files.

root@VPS:~# deluser --remove-all-files vpsuser

Thank you for reading and please feel free to leave any feedback.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s