Applications Systems
SAM Linux Script monitors that use the sudo command stop working on Red Hat Enterprise Linux (RHEL) systems that include the Defaults requiretty setting in the /etc/sudoers configuration file
This article describes workarounds for SAM Linux Script monitors that use the sudo command and stop working on Red Hat Enterprise Linux (RHEL) systems that include the Defaults requiretty setting in the /etc/sudoers configuration file. The following message may appear, "sudo: sorry, you must have a tty to run sudo".
First published date
Last published date
Overview
The following message may appear:
sudo: sorry, you must have a tty to run sud
Product section
Cause
Per a RHEL bug (© Red Hat, Inc., available at https://bugzilla.redhat.com, obtained on October 16, 2019), requiretty is no longer enabled by default in sudo-1.8.6p7-18.el7 because its impact on security is negligible and can be easily worked around.
Resolution
Alternatively, follow these instructions:
To disable the requiretty setting in the /etc/sudoers configuration file, remove the following line:
Defaults requirettyAlternatively, change the line to:
Defaults !requiretty
To learn more about SAM and Linux, see:
- Configure Linux/Unix systems for SAM templates and component monitors (SAM Administrator Guide)
- Create a Linux/Unix script monitor (SAM Administrator Guide)
- Linux/Unix Script monitor (SAM Administrator Guide)
- Linux Agent Deployment (THWACK)
- How to Monitor Linux with SSH and sudo (THWACK)