When you have a user account that you no longer need, you might want to delete the old account. You have a couple of methods to delete that old account, and the choice of which method to use depends on your own situation.
Log in to your system as the root user:
localhost$ ssh root@<remote_ip>You can delete the user, but keep the user's files. To do so, run the following command, as root:
# userdel olduserYou can delete the user, and the user's files (home directory). To do so, run the following command, as root:
# userdel -r olduserIf you are executing the commands using a non-root user with sudo privileges, remember to type sudo ahead of the command:
$ sudo userdel -r olduserUsing these commands, the user will be removed automatically from all the groups that it was added to, including the wheel group if it was given sudo privileges. If you need to add another user with the same name, at a later time, it will have to be added to the wheel group again to gain sudo privileges.