0

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.

quack quixote
  • 42,186
  • 14
  • 105
  • 129

2 Answers2

1

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

Earlz
  • 4,484
  • 18
  • 59
  • 84
0

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
Marnix A. van Ammers
  • 2,144
  • 1
  • 13
  • 15