# What is sudo password in the lab environment

**URL:** <https://discuss.elastic.co/t/what-is-sudo-password-in-the-lab-environment/375035>\
**Category:** Elastic Training\
**Created:** [February 25, 2025, 3:43pm UTC](https://discuss.elastic.co/t/what-is-sudo-password-in-the-lab-environment/375035 "2025-02-25T15:43:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Waldemar\_Schafer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/waldemar_schafer/32/141626_2.png) [@Waldemar\_Schafer](https://discuss.elastic.co/u/Waldemar_Schafer)\
**Post date:** [February 25, 2025, 3:43pm UTC](https://discuss.elastic.co/t/what-is-sudo-password-in-the-lab-environment/375035/1 "2025-02-25T15:43:03Z")

</div>

Course: Elastic Observability Engineer  
Version: 2025  
Question: In the Lab 2.1 Elastic Agent, Step 8-11 is requested to install the Elastic Agent which requires sudo permissions like this:  
`sudo ./elastic-agent install --url=https://fleet-server:8220 --enrollment-token=..........`  
As far as I understand Elastic Agent requires root privileges to work properly

---

<div class="post-metadata">

**Author:** ![Andre\_Murbach\_Maidl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andre_murbach_maidl/32/83508_2.png) [@Andre\_Murbach\_Maidl](https://discuss.elastic.co/u/Andre_Murbach_Maidl)\
**Post date:** [February 25, 2025, 3:54pm UTC](https://discuss.elastic.co/t/what-is-sudo-password-in-the-lab-environment/375035/2 "2025-02-25T15:54:00Z")

</div>

Hi @Waldemar_Schafer ,

you don't need `sudo` password for installing the Elastic Agent, but you need to paste and run the copied commands in a fresh terminal and from the `elastic` user home directory (`/home/elastic` or `~` ).

Just to make sure you are on the right path, you can run `cd ~` in your terminal window before pasting and running the command lines you copied.

Best,  
Andre

---

<div class="post-metadata">

**Author:** ![Waldemar\_Schafer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/waldemar_schafer/32/141626_2.png) [@Waldemar\_Schafer](https://discuss.elastic.co/u/Waldemar_Schafer)\
**Post date:** [February 25, 2025, 3:58pm UTC](https://discuss.elastic.co/t/what-is-sudo-password-in-the-lab-environment/375035/3 "2025-02-25T15:58:26Z")

</div>

> [@Waldemar\_Schafer](#):
>
> sudo ./elastic-agent install --url=[https://fleet-server:8220](https://fleet-server:8220) --enrollment-token=..........

Hi @Andre_Murbach_Maidl

I have restarted the environment with a fresh shell and tried this:

```auto
elastic@ip-172-31-35-63:~$ pwd
/home/elastic
elastic@ip-172-31-35-63:~$ sudo ./elastic-agent install --url=https://fleet-server:8220 --enrollment-token=..........
[sudo] password for elastic:

```

There are 2 reasons that sudo is required:

- in the step 12 it is explicitly asked for ` After the Elastic Agent is installed you can use `sudo /opt/Elastic/Agent/elastic-agent` in case you need to troubleshoot.`
- Elastic Agent requires root according the Elastic documentation

---

<div class="post-metadata">

**Author:** ![Andre\_Murbach\_Maidl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andre_murbach_maidl/32/83508_2.png) [@Andre\_Murbach\_Maidl](https://discuss.elastic.co/u/Andre_Murbach_Maidl)\
**Post date:** [February 25, 2025, 4:26pm UTC](https://discuss.elastic.co/t/what-is-sudo-password-in-the-lab-environment/375035/4 "2025-02-25T16:26:16Z")

</div>

Hi @Waldemar_Schafer ,

I'm sorry if I mislead the conversation. Yes, `sudo` is required and the environment is configured to allow `sudo` without password for installing and running the agent, but it is restricted to the path provided in lab instructions.

What is the path you are running the agent install?

That command must be executed from `/home/elastic/elastic-agent-8.8.2-linux-x86_64` directory.

Best,  
Andre

---

<div class="post-metadata">

**Author:** ![Waldemar\_Schafer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/waldemar_schafer/32/141626_2.png) [@Waldemar\_Schafer](https://discuss.elastic.co/u/Waldemar_Schafer)\
**Post date:** [February 25, 2025, 4:36pm UTC](https://discuss.elastic.co/t/what-is-sudo-password-in-the-lab-environment/375035/5 "2025-02-25T16:36:08Z")

</div>

Hi @Andre_Murbach_Maidl,

that was the point solving the problem. The installation was successful in the `/home/elastic/elastic-agent-8.8.2-linux-x86_64` directory.

So then the step 9 is wrong, because it is explicitly asking to `cd ~`

Thank you very much!!

---

<div class="post-metadata">

**Author:** ![Andre\_Murbach\_Maidl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andre_murbach_maidl/32/83508_2.png) [@Andre\_Murbach\_Maidl](https://discuss.elastic.co/u/Andre_Murbach_Maidl)\
**Post date:** [February 25, 2025, 5:06pm UTC](https://discuss.elastic.co/t/what-is-sudo-password-in-the-lab-environment/375035/6 "2025-02-25T17:06:14Z")

</div>

> So then the step 9 is wrong, because it is explicitly asking to `cd ~`

This steps asks to get back to home path, because if you are not and you paste the commands from Kibana they will not work. The environment is configured so when you copy and paste the commands from Kibana, the only thing you need to do is adding the certificate authority to the install command line.

Anyway, that's great to hear it worked out.

Best,  
Andre
