How to delete user on Ubuntu

To delete a user via the command line, open a terminal and execute the following command. Be sure to replace ‘username’ with the actual name of the user you wish to delete.

$ sudo userdel username

To remove the user’s home directory at the same time, add the -r option.

$ sudo userdel -r username

The userdel command won’t work if the user is currently logged in or has processes running under the account. In this case, you have two options. You can either kill all the user’s processes with the killall command or use the -f option with the userdel command to force deletion.

$ sudo killall -u username
OR
$ sudo userdel -f username

The user should now be eradicated from the system after successful execution of the userdel command.

  • 4321 utilizatori au considerat informația utilă
Răspunsul a fost util?

Articole similare

Advantages of ZFS

ZFS as a rather new filesystem offers various advantages in comparison to regular filesystems...

Analysing log files in Windows and Linux

Everyone knows the scenario, you want to analyze an issue of your server or local computer but...

Can i use TUN/TAP ?

Yes our VPS are KVM or Vmware based and you have your own kernel so using TUN/TAP is no problem.

Changing the Windows Administrator password – The easy way

Today we are going to show you how to change your Windows Administrator password the easy...

Command ‘curl’ not found on Ubuntu 20.04

The following error message may appear on your terminal hinting the unavailability of the curl...