How Add and Remove User in Linux?
Contents

How do you add and delete a user in Linux?

You can create, disable and remove user accounts using Linux admin commands. You can add/delete a user to a usergroup.
…
Linux/Unix user management commands.

Command Description
sudo userdel -r ‘username’ Delete a user
sudo usermod -a -G GROUPNAME USERNAME Add user a to a usergroup

How do you add and delete a user in Unix?

Adding a new user

  1. $ adduser new_user_name. Otherwise, if you do not have root access you can use the command below.
  2. $ sudo adduser new_user_name. …
  3. $ groups new_user. …
  4. We will now add the created user to the sudo group. …
  5. $ usermod -aG group_name user_name. …
  6. $ sudo deluser newuser. …
  7. $ sudo deluser –remove-home newuser.
Marcus Vance

Marcus Vance

Cybersecurity & Digital Privacy Researcher

Marcus Vance is a cybersecurity auditor and technology writer dedicated to educating the public about online safety, data privacy regulations, enterprise security, and emerging cyber threats.

Share this article
Twitter Facebook Pinterest