Sudo – How to Disable requiretty Per User

sudo

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?

Best Answer

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.