78

I don't want to comment out the line in /etc/sudoers:

Defaults    requiretty

Instead, I only want a certain user not to require a tty. How can this be done?

93

You said that you want one particular user to not require a tty. That's the default behavior. Nevertheless, you can explicitly set that like this:

Defaults:username !requiretty

If you want everyone else to require a tty, then you'll have to uncommment the line.

3

RedHat now recommends removing 'Defaults requiretty', conforming with the source code defaults. In Security Advisory RHSA-2016:2593, Redhat patched /etc/sudoers, removing line 'Defaults requiretty'

For additional details, see: https://bugzilla.redhat.com/show_bug.cgi?id=1196451 https://bugzilla.redhat.com/attachment.cgi?id=1155247&action=diff

Also, per user requiretty exceptions DO NOT WORK for RHEL/CENTOS 7 (sudo 1.8.6p7)

  • This is really great info but does not technically answer the question. – HarlemSquirrel Oct 2 '17 at 15:24
  • 2
    Do you have a link to a ticket about per user defaults not working on RHEL/CENTOS 7 ? Or maybe a link to release notes saying this has been fixed post 1.8.6p7 ? I'm not seeing anything about it under sudo.ws/stable.html – pwan Oct 4 '17 at 19:17

protected by Community Nov 1 '17 at 7:58

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.