1

For example, there is a line defining the rule in sudoers file:

%wheel ALL=(ALL) NOPASSWD: $HOME/bin/ls

is it valid? If not, is there an equivalent way to achieve this goal?

Thanks.

1
  • Are you trying to get $HOME to expand to the user who is running sudo, or the user who is the destination of the sudo (root in this case)? Oct 21, 2011 at 6:00

1 Answer 1

2

It is invalid. If you want to keep environment variables when running command via sudo, uncomment/add the following line, for e.g:

Defaults env_keep += "VBOX_APP_HOME"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .