> For the complete documentation index, see [llms.txt](https://cybersecurity-cloud-and-it-notes.gitbook.io/kyles-cybersecurity-cloud-and-it-gitbook/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cybersecurity-cloud-and-it-notes.gitbook.io/kyles-cybersecurity-cloud-and-it-gitbook/google-cybersecurity-professional-cert/4.-linux-and-sql-tool-of-the-trade/module-3/authenticate-and-authorize-new-users/add-and-delete-users.md).

# Add and delete users

#### Fun & ADHD-Friendly Notes on Adding and Deleting Users

🎉 **Welcome back! Let’s dive into adding and deleting users in Linux—super exciting stuff for security pros like us!**

***

#### 🚪 **Authentication: Why it matters**

* **Authentication** is like checking someone's ID before letting them in the building—only the right users get in.
* Just like in a real-life company, **you don’t want random people** accessing your system, but you also don’t want to accidentally lock out people who need access.
* **Add users** when they join the team, **delete users** when they leave. Simple!

***

#### 🦸‍♂️ **Root User – The Superhero of Linux**

* **Root user** = Superuser 🦸‍♂️ (aka the person with ALL the powers!)
  * They can modify anything, run programs, and control the system.
  * **BUT WAIT!** Using the root account all the time is risky! ⚠️
    * **Security Risk**: Root is a hacker's dream, so avoid logging in as root if possible.
    * **Easy Mistakes**: One wrong command, and poof 💥—you could accidentally delete a whole directory.
    * **No Accountability**: There’s no way to track **who** made a change when using root. Uh-oh, no detectives in sight 🕵️.

***

#### 🛡️ **Enter the Sudo Command** – Superpower with limits 🦸‍♀️

* **sudo** = SuperUser Do (cool name, right?)
  * It gives users temporary elevated powers **WITHOUT logging in as root.**
  * You’ll be asked for a password first for security checks 🛡️.
  * **Not everyone gets sudo access**—only the chosen ones (aka those listed in the **sudoers** file). 👑

***

#### 📝 **How to Add and Delete Users like a Pro**

* **Add users**: Use the `useradd` command. Only **root** or **sudo users** can do this.
  * Example:

    ```bash
    sudo useradd salesrep7
    ```
  * Just like magic, no output means success! 🎉 (Error? Oops! Maybe you mistyped, or forgot sudo!)
* **Delete users**: Use the `userdel` command. Again, only **sudo powers** can do this.
  * Example:

    ```bash
    sudo userdel salesrep7
    ```
  * Poof! The user is gone. 👋 No error = success.

***

#### 🧠 **Key Takeaways**:

* **Sudo** = temporary powers; use responsibly.
* **useradd** = add users, **userdel** = delete users.
* Always be careful with elevated privileges—don’t mess things up like a bull in a china shop! 🐂🍽️

***

#### 🎮 Level Up! Use sudo wisely to ensure the **principle of least privilege** is followed, and keep your system secure!
