0

The sudoers file provides a way to limit which "runas" entries apply to which hosts. When running a command with sudo, the hostname is checked against the hosts on which a "runas" entry applies.

When the host-name is misconfigured, this can cause sudo to take a long time trying to resolve the hostname, and sometimes it will entirely prevent users from using sudo.

But most sudoers configurations I've seen only ever use the ALL host alias, meaning that it shouldn't matter what host the user is on. Why does sudo even perform the check in this case, since it can cause problems?

1

At the risk of trying to read Todd Miller's mind, I'll just say that sudo is configured to report the hostname in the logging it does, so it has to look it up. See the log_denial function at:

https://www.sudo.ws/repos/sudo/file/f19c689a2ded/plugins/sudoers/logging.c

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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