# Sudo password error

**URL:** <https://discuss.elastic.co/t/sudo-password-error/382407>\
**Category:** Elastic Training\
**Created:** [October 3, 2025, 5:06pm UTC](https://discuss.elastic.co/t/sudo-password-error/382407 "2025-10-03T17:06:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sbelmont](https://avatars.discourse-cdn.com/v4/letter/s/df705f/32.png) [@sbelmont](https://discuss.elastic.co/u/sbelmont)\
**Post date:** [October 3, 2025, 5:06pm UTC](https://discuss.elastic.co/t/sudo-password-error/382407/1 "2025-10-03T17:06:28Z")

</div>

Hello,

I had to reset my lab environment, after which I had to start the lab training from the first to bring back the training data.  
I added Nginx and should add an agent. I am using the code from the lab, but I cannot go forward because of the mismatching password. This is the command from the lab:

sudo ./elastic-agent install …8220 --enrollment-token=TG5QWHFwa0JJTVVSV1h4cVc3azU6al9WbFRMVW1TbEMydm9NN21fRC1Zdw==

When I was taking the course earlier, it did not ask me any password, but now it prompts me for sudo password. I used the one from heartbeat.yml (JcRZwmwBPduguAuv), but it did not take. I also tried the training password (noprodpwd). It did not work, either. Please help me.

Error content:

elastic@ip-172-31-28-230:~/heartbeat/elastic-agent-8.8.2-linux-x86\_64$ sudo ./elastic-agent install --…r:8220 --enrollment-token=TG5QWHFwa0JJTVVSV1h4cVc3azU6al9WbFRMVW1TbEMydm9NN21fRC1Zdw==  
[sudo] password for elastic:  
Sorry, try again.  
[sudo] password for elastic:  
Sorry, try again.  
[sudo] password for elastic:

========================================================================

Full command:  
curl - … beats/elastic-agent/elastic-agent-8.8.2-linux-x86\_64.tar.gz  
tar xzvf elastic-agent-8.8.2-linux-x86\_64.tar.gz  
cd elastic-agent-8.8.2-linux-x86\_64  
sudo ./elastic-agent install --url=… --enrollment-token=TG5QWHFwa0JJTVVSV1h4cVc3azU6al9WbFRMVW1TbEMydm9NN21fRC1Zdw==

---

<div class="post-metadata">

**Author:** ![Tortoise](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tortoise/32/147587_2.png) [@Tortoise](https://discuss.elastic.co/u/Tortoise)\
**Post date:** [October 4, 2025, 1:56am UTC](https://discuss.elastic.co/t/sudo-password-error/382407/2 "2025-10-04T01:56:39Z")

</div>

Hello @sbelmont

Could you please check the below post if it is helpful in your case :

> [@What is sudo password in the lab environment](https://discuss.elastic.co/t/what-is-sudo-password-in-the-lab-environment/375035/4):
>
> 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

Thanks!!

---

<div class="post-metadata">

**Author:** ![sbelmont](https://avatars.discourse-cdn.com/v4/letter/s/df705f/32.png) [@sbelmont](https://discuss.elastic.co/u/sbelmont)\
**Post date:** [October 6, 2025, 7:25pm UTC](https://discuss.elastic.co/t/sudo-password-error/382407/3 "2025-10-06T19:25:43Z")

</div>

The SU password error has been replaced to a new error. I was running the command in the directory as you recommended. How can I run the command elsewhere??

I cannot copy the full error message because this post spits out error for the content:  
An error occurred: Sorry you cannot post a link to that host.

============= This is some of the error content

Elastic Agent will be installed at blah/Agent and will run as a service. Do you want to continue? [Y/n]:Y

"file.name":"cmd/enroll\_cmd.go","file.line":478,"message":"Starting enrollment to :

Error: fail to enroll: fail to execute request to fleet-server: x509: certificate signed by unknown authority
