Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support sudo without -E #23

Closed
schlamar opened this issue Sep 11, 2013 · 4 comments · Fixed by #25
Closed

Support sudo without -E #23

schlamar opened this issue Sep 11, 2013 · 4 comments · Fixed by #25

Comments

@schlamar
Copy link

Proxy settings are lost when using sudo without the -E flag:

$ echo $http_proxy
http://.../
$ sudo su
# echo $http_proxy

#

The solution is to add the variables to the env_keep sudo settting. Just create a file with owner root and mode 0440 as /etc/sudoers.d/proxy with the content:

Defaults env_keep += "http_proxy https_proxy ftp_proxy no_proxy"

References:

@tknerr
Copy link

tknerr commented Sep 11, 2013

👍

@tmatilai
Copy link
Owner

Yet another great idea. Thanks Marc! 👍
Worth a note that some old distros don't have sudoers.d enabled by default, but luckily they are slowly vanishing.

I'll definitely implement this. But I plan to cut a release first for #21 today.

@tmatilai
Copy link
Owner

@schlamar PR #25 ready for testing and review. =)

@tmatilai
Copy link
Owner

Released in v0.5.1. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants