Keeping current Environmental variables when sudo

This is pretty easy to fix just need to add an exception to the sudoers file for the variable your trying to pass.

in /etc/sudoers add the following line

Defaults      env_keep+="JAVA_HOME"

You will notice that the following line in sudoers is what resets the variables

Defaults      env_reset
Advertisements

About Paul Cardelli, CISSP
Cyber Security Analyst, and computer guru

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: