8

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
9

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=http://127.0.0.1:5865
export https_proxy=http://127.0.0.1:5865
export ftp_proxy=http://127.0.0.1:5865

/etc/environment

http_proxy=http://127.0.0.1:5865
https_proxy=http://127.0.0.1:5865
ftp_proxy=http://127.0.0.1:5865

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

Acquire::http::Proxy "http://127.0.0.1:5865";
Acquire::https::Proxy "http://127.0.0.1:5865";
Acquire::ftp::Proxy "http://127.0.0.1:5865";
  • 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? – Galgalesh 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
1

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

http_proxy="http://name:password@proxy_server:port/"
export http_proxy

I hope this works for you, too. ;)

  • 1
    This is exactly the same, just in two lines instead of one... – Galgalesh 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
0

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.

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.