15

I want to update ubuntu 11.04 throught apt-get. So I added the following lines in apt.conf

export http_proxy=http://username:[email protected]:port/
export ftp_proxy=http://username:[email protected]/

export http_proxy=http://deepak:Deepak@[email protected]:3128

My question is: how do I insert special characters to a username or password?

For instance: my password for proxy is Deepak@123 and it is getting an error.

2
  • 6
    Er... is that really your password? Oct 18, 2011 at 5:10
  • You can export proxy settings in .bashrc. In apt.conf you have to use this
    – Nemo
    Oct 18, 2011 at 5:16

4 Answers 4

26

You need to escape special characters. So place a \ in front of the @ like so:

export http_proxy=http://deepak:Deepak\@[email protected]:3128

Alernatively you can also use %40.

4
4

Click on

  1. Dash home
  2. Search for System Settings
  3. Select Network
  4. Select Network Proxy
  5. Select Manual method
  6. Set you proxy and port

Kudos You are Done if you set right

4

If your password or username contains @ you can percent-encode (also referred as URL encoding) it as %40 in the proxy url. For more special characters see here

0
0

Even more simple and Reliable!

General Syntax:

sudo {http,https,ftp}_proxy=http://<username>:<password>@<proxy_url/_proxyip>:<port>/ wget --timeout=5 --no-check-certificate http://<website_url>

Example:

[root@localhost ~]# sudo {http,https,ftp}_proxy=http://username:[email protected]:6050/ wget --timeout=5 --no-check-certificate http://google.com

{http,https,ftp}_proxy -> http, https, ftp urls. Seperated by comma.

--timeout=5 -> Connection to keep alive in seconds.

-no-check-certificate -> Ignore SSL / Certificate Verification.

--spider -> If you want to test the connectivity without downloading the file.

Notes:

Online Converter:

Replace special characters with its equivalent hexadecimal unicode. For a list of unicodes refer the website https://unicode-table.com (or) http://unicodelookup.com

Local Converter using Python:

Reference: conversion of password "p@s#w:E" to unicode will be as follows,

@ = %40
$ = %24
# = %23
: = %3A
p@s#w:E = p%40s%23w%3AE

Input:

[root@localhost ~]# python -c "import sys, urllib as enc; print enc.quote_plus(sys.argv[1])" "p@s#w:E"

Output:

p%40s%23w%3AE

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .