Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm trying to write a universal sudoers file to control permissions for all our users across all our environments and I've been using the wildcard for the hostnames like so (all data has been anonymized)

Host_Alias stg01     = *
Host_Alias stg02     = *
Host_Alias stg03     = *
Host_Alias prod      = *, *
Host_Alias prod02    = *, *
Host_Alias prod03    = *
Host_Alias db01      = *
Host_Alias db02      = *
Host_Alias db03      = *
Host_Alias hi02      = *
Host_Alias env1      =, *
Host_Alias env2      = *, *, *, *, *, *
Host_Alias testhosts =,,,
Host_Alias env3      =, *
Host_Alias env4 = *, *, *
Host_Alias env5  = *, *, *, *.hiho.sfo.acme.comsfo

When I try it, I get:

>>> sudoers file: syntax error, line 0 <<<

and it repeats all the way to line 16. This is on a Solaris x86 server running sunOS 5.10.

Did I do something wrong? a visudo -c -f returns fine on my linux testbox so I'm confused.

Any ideas would be appreciated!


share|improve this question

2 Answers 2

up vote 1 down vote accepted

Have you tried running w/o wildcard hosts and then adding one of them back to see if sudo gets bothered? This would clear up the question as to whether wildcards on hosts are allowed.

share|improve this answer

I needed to use capital letters for all the host aliases. so STG01 instead of stg01 and so on :)

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.