Interview Prep/Ansible/Connection and SSH Failures

`Timeout (12s) waiting for privilege escalation prompt`

IntermediateTroubleshootingConnection and SSH Failures
Answer

Likely causes → sudo is asking for a password in a different form than expected, requiretty is set, a slow PAM or DNS lookup delays the prompt, or become_method does not match the host.

Diagnose →

ssh host 'sudo -n true'
ansible web01 -b -m ping -vvv

Check /etc/sudoers and /var/log/auth.log.

Fix → Increase timeout, fix DNS (/etc/hosts with the hostname), set ansible_become_method, or use passwordless sudo for the automation user.

Prevent → Make sure the hostname resolves locally on every target.

All Ansible questions Roadmap: Ansible

More on Connection and SSH Failures