What is sudo password in the lab environment

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

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

Hi @Andre_Murbach_Maidl

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

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

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

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!!

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