mymachine:/etc/sudoers includes the line
joe someremotehost = (ALL) NOPASSWD: ALL
someremotehost:/etc/sudoers does not say anything special about
joe, then what effect does the above line have?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
In its default configuration,
sudo looks in the
sudoers file on the local machine (i.e., on the machine upon which it is invoked) to determine what to do - it doesn't contact another host to find out what it would permit, so in this case, the
joe someremotehost line on your local machine would not affect the operation of
someremotehost. And since it specifies a hostname restriction,
sudo on your local machine would ignore the rule, because the hostname in the config doesn't match the hostname
sudo gets from the C library.
sudoers file syntax allows you to specify hostname restrictions so that managing policy for a large group of hosts is as easy as editing the file in one place, and then pushing it out to all hosts in the administrative domain.