[sudo-users] Letting just selected environment variables through

Todd C. Miller Todd.Miller at courtesan.com
Thu Aug 3 11:25:20 MDT 2017


The latest beta version of sudo 1.8.21 includes support for preserving
specific environment variables.  To wit:

$ sudo -V
Sudo version 1.8.21b2
Sudoers policy plugin version 1.8.21b2
Sudoers file grammar version 46
Sudoers I/O plugin version 1.8.21b2

$ export EXAMPLE=present

$ sudo printenv EXAMPLE
[nothing]

$ sudo --preserve-env=EXAMPLE printenv EXAMPLE
present

More than one variable name can be specified, separated by commas.

 - todd


More information about the sudo-users mailing list