[sudo-users] Using an environment variable in sudoers?

Shawn McMahon syberghost at gmail.com
Tue Oct 18 07:57:50 MDT 2016

On Tue, Oct 18, 2016 at 8:48 AM, leam hall <leamhall at gmail.com> wrote:

> Working through the things I've been asked to do. Most of them seem okay so
> far, but still stuck on using an environment variable in a sudoers file.
> What I'm looking for is to be able to put "$LEAM_PATH/my_command.sh" in
> suders. I've tried to add the following to /etc/sudoers.d/my_commands but
> get a syntax error.
>  Defaults env_keep += "LEAM_PATH"
>  leam                       ALL = $LEAM_PATH/my_command.sh

A completely equivalent rule would be:

leam       ALL = ALL

More information about the sudo-users mailing list