Host_Alias questions

Todd C. Miller Todd.Miller at
Wed Aug 21 02:54:47 EDT 2002

In message <20020819155044.B22300 at>
	so spake root (root):

> I have a few quick questions regarding Host_Alias.
> 1.  Is there a way to specify Host_Alias -1 host (for example, all hosts exce
> pt hostX)?  In this example, the user could use sudo on all hosts except host
> X.

You can do, e.g.

    UserX Hosts1, !server = ALL

to allow "UserX" to run any command on the hosts in "Hosts1" except
for the machine "server".

> 2.  Can you add more than one Host_Alias to a User Specification?  Lets say I
>  have yo Host_Alias definitions:
> Host_Alias	Hosts1=hostA,hostB,hostC
> Host_Alias	Hosts2=hostD,hostE,hostF
> Could I set up UserX with this definition:
> UserX	Hosts1=ALL Hosts2=ALL
> If I can, amd I using the corrct syntax?

Sure, you just separate the entries with a colon (':'), e.g.

    UserX Hosts1=ALL : Hosts2=ALL

> 3.  Can a Host_Alias definition overlap with another?
> Example:
> Host_Alias	Hosts1=hostA,hostB,hostC
> Host_Alias	Hosts2=hostB,hostD,hostE,hostF

Yes, that's fine.

 - todd

More information about the sudo-users mailing list