Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am using Curl, and am having a problem trying to get it to recognize the $http_proxy environment variable when using sudo curl. I tried putting export http_proxy=.... in my /etc/profile and restarting the shell, to no avail. I would rather not use su -l and run the command while logged in as root.

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

Look in /etc/sudoers. There is a list of environmental variables that get shared between sudo and the regular user shell

share|improve this answer
add comment

You might need to add:

envkeep http_proxy

to your sudoers file. Check your sudo environmental variables by running:

sudo -V

as root. Or by running:

sudo sudo -V
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.