1

I am trying to set proxy for a ubuntu server 12.04. Our proxy user name contains in the format:

CompanyName\UserName

and Password like:

$test

I tried to set proxy like this:

export http_proxy='http://CompanyName\UserName:$test@proxy.company.com:8080/' 

But when I run any commands which require internet, like sudo apt-get etc, still I am getting error, 407 Proxy Authentication Required.

As far as I am aware the above command should be correct. I searched lot and got above syntax, but not sure how to deal with proxy username containing like above.

Can anyone guide me?

Bhushan Kawadkar
  • 275
  • 1
  • 4
  • 8

1 Answers1

0

Sudo does not preserve your environment variable. See the following link for an answer on how to configure sudo to do it:

https://superuser.com/questions/232231/how-do-i-make-sudo-preserve-my-environment-variables

jhilmer
  • 1,185
  • 9
  • 13