Remove a Linux user

You can remove old users from your Linux server. This will revoke the user’s SSH access, and remove that user’s file and directory owner

Remove the user

  1. Log in to your server via SSH.
  2. Switch to the root user:
    sudo su –
  3. Use the userdel command to remove the old user:
    userdel user’s username
  4. Optional: You can also delete that user’s home directory and mail spool by using the -r flag with the command:
    userdel -r user’s username

About Damon Luong

San Jose, California
This entry was posted in command line of linux, My Linux. Bookmark the permalink.