I would like to access the internet to update files etc. from the terminal on a secured proxy network. I've already tried the following:

  1. Adding to /etc/apt/apt.conf, /etc/apt/apt.conf.d/01proxy, /etc/apt/apt.conf.d/01ubuntu:

    Acquire::http::proxy "http://name:password@proxy_server:port";
  2. export http_proxy=http://name:password@proxy_server:port/ on a terminal.

  3. Adding export http_proxy=http://name:password@proxy_server:port/to /etc/bash.bashrc

These were few of the major efforts. There are no spaces in my username nor are there any special characters in my password (especially "@"). I've double checked and all the information entered is correct. The info is correct because it works with the browser (Manual proxy in Network and authentication when first opened the browser). I've also tried by making the "p" in "proxy" into capitals but to avail. I always get the error: 407 Proxy Authentication Required. Any help is appreciated.

  • Where do ntlmaps (or cntlm) come from? Are they part of the install? But if they come from an internet store, how is this going to work if the internet connection is what's not working? – user356524 Dec 10 '14 at 17:36

Test this:

sudo su -
apt-get update
apt-get install ntlmaps

Configure it: domain, username, password, proxyserver.net, port

Files: /etc/bash.bashrc

export http_proxy=
export https_proxy=
export ftp_proxy=



/etc/apt/apt.conf (create the file if it does not exist)

Acquire::http::Proxy "";
Acquire::https::Proxy "";
Acquire::ftp::Proxy "";
| improve this answer | |
  • Another option is to use cntlm: apt-get install cntlm. I have not measured, but cntlm is supposed to have better performance. This seems reasonable since cntlm is C and ntlmaps is Python – codeape Oct 8 '14 at 11:37
  • 7
    How can you download ntlmaps when you have no internet connection because you need to connect to a proxy? – Merlijn Sebrechts Mar 3 '15 at 8:17
  • Now wget, apt-get update, and apt-get upgrade are not hanging, but apt-get is failing and wget is saying "Proxy request sent, awaiting response." Not sure what's going on. No one has a terminal solution at my work bc they all use the GUI. – JFA Jun 18 '15 at 14:35

What you did (export http_proxy=http://name:password@proxy_server:port/) is actually pretty close to what works for me:

export http_proxy

I hope this works for you, too. ;)

| improve this answer | |
  • 1
    This is exactly the same, just in two lines instead of one... – Merlijn Sebrechts Mar 3 '15 at 8:15
  • 2
    It works for me if I use quatation marks. Without it doesn't... – octavian Mar 4 '15 at 9:57

It is possible that your password has a special character that needs to be 'escaped', or be encoded properly for a URL.

For example, the following characters need to be encoded (but there are many others):

  • #
  • @
  • %

If your password contains special characters, be sure they are properly URL-encoded.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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