How to configure sudoers to always keep LD_LIBRARY_PATH envrionment variable?

Posted by Yanick Girouard on Server Fault See other posts from Server Fault or by Yanick Girouard
Published on 2012-03-20T16:36:52Z Indexed on 2012/03/20 17:31 UTC
Read the original article Hit count: 284

No matter what I try, it seems that the LD_LIBRARY_PATH environment variable is not kept after I run a command with sudo. The only way I managed to have it stick, is to prefix my sudo command with LD_LIBRARY_PATH=/the/path whenever I call it from the command-line, but I would like to not have to do this every time.

It seems the env_keep option ignores this variable, and so does the exempt_group option.

My %group currently has ALL=(ALL) NOPASSWD:ALL as its access in sudoers. I would like this specific environment variable to be kept for any command I run.

How can I do this?

My server is running Red Hat Enterprise Linux 5.7.

© Server Fault or respective owner

Related posts about redhat

Related posts about sudo