# Incorrect sudo password

**URL:** <https://forum.ansible.com/t/incorrect-sudo-password/8465>\
**Category:** Get Help\
**Created:** [September 12, 2024, 2:25pm UTC](https://forum.ansible.com/t/incorrect-sudo-password/8465 "2024-09-12T14:25:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Indirajith\_V](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/indirajith_v/32/4720_2.png) [@Indirajith\_V](https://forum.ansible.com/u/Indirajith_V)\
**Post date:** [September 12, 2024, 2:25pm UTC](https://forum.ansible.com/t/incorrect-sudo-password/8465/1 "2024-09-12T14:25:43Z")

</div>

I am trying to use sudo for on worker nodes to execute a task. Even with the correct password, ansible fails with incorrect sudo password error.

Can anyone please help me understand the problem?

```auto
fatal: [g1]: FAILED! => {
    "msg": "Incorrect sudo password"

```

So, the command I am trying to execute is kubeadm join, to join worker nodes to a cluster using ansible. And I get this error even with correct sudo password.  
Thank you.

---

<div class="post-metadata">

**Author:** ![Denney-tech](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/denney-tech/32/1556_2.png) [@Denney-tech](https://forum.ansible.com/u/Denney-tech)\
**Post date:** [September 12, 2024, 3:09pm UTC](https://forum.ansible.com/t/incorrect-sudo-password/8465/2 "2024-09-12T15:09:15Z")

</div>

Are you passing the become password? Ansible doesn’t (necessarily) assume that the given ssh password is to be re-used for the become (sudo) password.

You need to pass `--ask-become-pass` or `-K` (uppercase) when executing the playbook. If you’re using `--ask-pass` or `-k` (lowercase) at the same time, then you can enter the password for ssh and leave the become password blank at the prompt (just hit enter) and _only then_ will Ansible re-use the password. If you’re using ssh keys or some other auth method instead of prompting for password with `-k`, then you _must_ enter the become password when prompted with `-K`.

Edit: If you don’t want to prompt for password, you can also specify the password as a variable with `ansible_become_password: 'password'`, but I recommend vault encrypting the password if you go this route.
