Interview Prep/Ansible/Privilege Escalation and Python Interpreter Issues

`sudo: sorry, you must have a tty to run sudo`

IntermediateTroubleshootingPrivilege Escalation and Python Interpreter Issues
Answer

Likely causes → Defaults requiretty in /etc/sudoers (older RHEL/CentOS) and pipelining enabled.

Diagnose → grep requiretty /etc/sudoers /etc/sudoers.d/*.

Fix →

Defaults:ansible !requiretty

or disable pipelining.

Prevent → Use visudo -cf validation when deploying sudoers files.

All Ansible questions Roadmap: Ansible

More on Privilege Escalation and Python Interpreter Issues