# I have setup an ansible user that can login with a ssh-key  and sudo su - with no password but this appears not to work.

**URL:** <https://forum.ansible.com/t/i-have-setup-an-ansible-user-that-can-login-with-a-ssh-key-and-sudo-su-with-no-password-but-this-appears-not-to-work/31036>\
**Category:** Ansible Project\
**Created:** [August 13, 2019, 8:34pm UTC](https://forum.ansible.com/t/i-have-setup-an-ansible-user-that-can-login-with-a-ssh-key-and-sudo-su-with-no-password-but-this-appears-not-to-work/31036 "2019-08-13T20:34:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Steven\_Mething](https://avatars.discourse-cdn.com/v4/letter/s/ee7513/32.png) [@Steven\_Mething](https://forum.ansible.com/u/Steven_Mething)\
**Post date:** [August 13, 2019, 8:34pm UTC](https://forum.ansible.com/t/i-have-setup-an-ansible-user-that-can-login-with-a-ssh-key-and-sudo-su-with-no-password-but-this-appears-not-to-work/31036/1 "2019-08-13T20:34:58Z")

</div>

How do I fault find such an issue?

[svc\_build@vuwunicorhsat01 ~]$ ansible-playbook site.yml

PLAY [build] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [Gathering Facts] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
fatal: [vuwunicopatch8a.ods.vuw.ac.nz]: FAILED! =\> {“changed”: false, “module\_stderr”: “Shared connection to vuwunicopatch8a.ods.vuw.ac.nz closed.\r\n”, “module\_stdout”: “sudo: a password is required\r\n”, “msg”: “MODULE FAILURE\nSee stdout/stderr for the exact error”, “rc”: 1}  
to retry, use: --limit @/home/svc\_build/site.retry

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
vuwunicopatch8a.ods.vuw.ac.nz : ok=0 changed=0 unreachable=0 failed=1

[svc\_build@vuwunicorhsat01 ~]$ ssh vuwunicopatch8a.ods.vuw.ac.nz -l svc\_build  
Activate the web console with: systemctl enable --now cockpit.socket

Last login: Wed Aug 14 08:26:56 2019 from 10.100.32.67  
[svc\_build@vuwunicopatch8a ~]$ sudo su -  
Last login: Wed Aug 14 08:20:20 NZST 2019 on pts/0  
[root@vuwunicopatch8a ~]# ^C  
[root@vuwunicopatch8a ~]# logout  
[svc\_build@vuwunicopatch8a ~]$ logout  
Connection to vuwunicopatch8a.ods.vuw.ac.nz closed.  
[svc\_build@vuwunicorhsat01 ~]$ more site.yml

---

<div class="post-metadata">

**Author:** ![Sebastian\_Meyer](https://avatars.discourse-cdn.com/v4/letter/s/779978/32.png) [@Sebastian\_Meyer](https://forum.ansible.com/u/Sebastian_Meyer)\
**Post date:** [August 13, 2019, 8:52pm UTC](https://forum.ansible.com/t/i-have-setup-an-ansible-user-that-can-login-with-a-ssh-key-and-sudo-su-with-no-password-but-this-appears-not-to-work/31036/2 "2019-08-13T20:52:30Z")

</div>

Hi Steven,

---

<div class="post-metadata">

**Author:** ![Steven\_Mething](https://avatars.discourse-cdn.com/v4/letter/s/ee7513/32.png) [@Steven\_Mething](https://forum.ansible.com/u/Steven_Mething)\
**Post date:** [August 14, 2019, 12:18am UTC](https://forum.ansible.com/t/i-have-setup-an-ansible-user-that-can-login-with-a-ssh-key-and-sudo-su-with-no-password-but-this-appears-not-to-work/31036/3 "2019-08-14T00:18:12Z")

</div>

Hi,

Thanks but I do not use a local sudoers file but sudo to root via Redhat’s IPA. It works OK now the sssd setup was corrupted or an ongoing bug maybe. Normally I’d expect something to appear in /var/log/secure but not in this case, hence confusion.
