If you want to remove unwanted user from your server then you can follow below steps:
You can run below command to delete the user:
Here username is “hoststud”.
With this if you want to remove all the files which are related to the user then you have to add –r:
Now we have to remove root privileges of the user, for that first you have to use vim editor:
Now find below code in file :
Now you have to remove below line from file:
You can run below command to delete the user:
Here username is “hoststud”.
Code:
Userdel hoststud
Code:
Userdel –r hoststud
Code:
Visudo
Code:
## Allow root to run any commands anywhere
root ALL=(ALL) ALL
hoststud ALL=(ALL) ALL
Code:
hoststud ALL=(ALL) ALL