Remove the user step by step


Step 1 : Log in to your server via SSH.

Step 2 : Switch to the root user:

sudo su -

Step 3 : Remove comands

Command to remove the user:

userdel username

You can also delete user & user's home directory with the command:

userdel -r username

Step 4 : Remove Root Privileges to the User (Optional)

Find the following code:

## Allow root to run any commands anywhere
root ALL=(ALL) ALL
username ALL=(ALL) ALL

In this case, we’re removing root privileges from the user username . Remove the following:

username ALL=(ALL) ALL

Then exit and save the file with the command :x

Keywords:

How to remove an user on CentOS
How to remove an user on CentOS 6
How to remove an user on CentOS 7
How to remove an user on Ubuntu
How to remove an user on Linux