Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

can anybody tell me in which case the sudo host definition is useful?

I mean this part of a line in the sudoers file:

bob host1 = NOPASSWD: reboot

In which environment (except sudo via LDAP) do I need to define the host on which a user can run the specified command?

share|improve this question

Here are some things I can think of:-

  • You deploy sudoers via a central source using some configuration management system.
  • The file exists on an NFS share mounted by multiple hosts.
  • A particular system uses many UTS namespaces (different containers have different hostnames)
  • You may intend a particular set of permissions on a particular hostname (which represents a role of a system such as a webserver). But you later change the hostname as it changes roles, this removes sudo capabilities for users with a hostname listed.
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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