3

I have my /etc/environment file set up with proxy settings. It looks like this -

http_proxy="http://userName:password@proxy:port/"
https_prxoxy="http://userName:password@proxy:port/"

The password contains an @ symbol which somehow seems to be conflicting with the latter @ symbol because of which I am not able to connect to the network. How do I escape the @ symbol in the password?

αғsнιη
  • 35,660
aandis
  • 133
  • 3
  • Have you tried changing the double quotes to single ones? Or am I misunderstanding? Another option might be adding a backslash (\\) before the first @ character. If that doesn't work take a look here; http://serverfault.com/questions/506053/how-does-one-properly-escape-a-leading-character-in-linux-etc-environment – Seth Mar 30 '15 at 18:36
  • changing to single quote did not work! – aandis Mar 30 '15 at 18:51
  • @Seth: The backslash will work at shell level, not at connection level. – 0x2b3bfa0 Mar 30 '15 at 19:48

1 Answers1

3

Lets say that the password is 123@456. In that case, the correct wat to escape the @ symbol is this:

http_proxy="http://userName:123%40456@proxy:port/"
https_prxoxy=same_as_above

I've only replaced the @ with its ASCII hexadecimal representation (%40)

0x2b3bfa0
  • 8,780
  • 6
  • 36
  • 55