11

In the sudoers file, how can I use multiple Tag_Specs on the same line.

Normally if I don't want to ask for a password I will do something like this:

who  where = (aswhom) NOPASSWD: commands

I want to use the SETENV tag so that users can preserve environment variables. This works fine like this:

who  where = (aswhom) SETENV: commands

From the sudoers(5) man page:

    Tag_Spec ::= ('NOPASSWD:' | 'PASSWD:' | 'NOEXEC:' | 'EXEC:' |
                  'SETENV:' | 'NOSETENV:' | 'LOG_INPUT:' | 'NOLOG_INPUT:' |
                  'LOG_OUTPUT:' | 'NOLOG_OUTPUT:')

I can't see how I can use multiple tags on the same entry. I would both like to use NOPASSWD and SETENV on the same line.

David
  • 376
  • 1
  • 3
  • 9

1 Answers1

22

The same commands:

who  where = (aswhom) NOPASSWD:SETENV: commands

The different commands:

who  where = (aswhom) NOPASSWD: command1, SETENV: command2
quanta
  • 51,413
  • 19
  • 159
  • 217