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

Configure sudo to preserve the *_proxy environment variables #25

Merged
merged 3 commits into from
Sep 13, 2013

Conversation

tmatilai
Copy link
Owner

Requires that sudo in the VM is configured to support "sudoers.d", i.e. /etc/sudoers contains line:

#includedir /etc/sudoers.d

This should be the default on all recent Linux distros, but not for example in CentOS 5.

Also create the directories for configuration files (for example /etc/sudoers.d/) if they don't exist.

Fixes #23.

@tmatilai tmatilai mentioned this pull request Sep 13, 2013
@schlamar
Copy link

Looks good 👍

$ sudo cat /etc/sudoers.d/proxy
Defaults env_keep += "HTTP_PROXY HTTPS_PROXY FTP_PROXY NO_PROXY"
Defaults env_keep += "http_proxy https_proxy ftp_proxy no_proxy"

$ sudo curl https://google.com
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>301 Moved</TITLE></HEAD><BODY>
<H1>301 Moved</H1>
The document has moved
<A HREF="https://www.google.com/">here</A>.
</BODY></HTML>

tmatilai added a commit that referenced this pull request Sep 13, 2013
Configure sudo to preserve the `*_proxy` environment variables
@tmatilai tmatilai merged commit e9ad512 into master Sep 13, 2013
@tmatilai tmatilai deleted the sudo-env-keep branch September 13, 2013 19:21
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 this pull request may close these issues.

Support sudo without -E
2 participants