Remove a user and group in linux (Centos / Ubuntu)
Learn how to remove a user in linux. Learn how to remove a group in linux.
Removing a user in linux
To remove a user, we use userdel command.
sudo userdel <user-name>
sudo userdel clouduser
You can also delete that user’s home directory and mail spool by using the -r flag with userdel command.
sudo -r userdel clouduser
Removing a group in linux
To delete a group, groupdel command is used.
sudo groupdel <group-name>
sudo groupdel cloudgroup