# Installing sudo & configuration of user and groups

{% hint style="info" %} <mark style="color:green;">**sudo**</mark> is a [program](https://en.wikipedia.org/wiki/Computer_program) for [Unix-like](https://en.wikipedia.org/wiki/Unix-like) computer [operating systems](https://en.wikipedia.org/wiki/Operating_system) that enables users to run programs with the security privileges of another user, by default the [superuser](https://en.wikipedia.org/wiki/Superuser). It originally stood for "superuser do", as that was all it did, and it is its most common usage; however, the official Sudo project page lists it as "su 'do' ".
{% endhint %}

## Installing sudo

1. **Switch to root user:** First, we need to change to the root user to install sudo. Enter the following command:

```bash
su
```

When prompted, enter the root password you set during installation (in our example: `Hola42bcn`).

2. **Install sudo package:** Once you're logged in as root, run the following command:

```sh
apt install sudo
```

This command tells the package manager to install the required packages for sudo. Press `y` when prompted to confirm the installation.

3. **Reboot the system:** We must reboot the machine so the changes can be applied. Use the following command:

```shell
sudo reboot
```

4. **Verify installation:** Once the machine has rebooted, enter the encryption password and log in again. To check if sudo has been installed correctly, switch to the root user:

```sh
su
```

Then verify the sudo installation with:

```sh
sudo -V
```

This command will display the sudo version and configuration details if the installation was successful.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://noreply.gitbook.io/born2beroot/virtual-machine-setup/installing-sudo-and-configuration-of-user-and-groups.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
