Proxy authentication with terminal Ubuntu 14.04

96,515

Solution 1

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";

Solution 2

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. ;)

Share:
96,515

Related videos on Youtube

muru
Author by

muru

Updated on September 18, 2022

Comments

  • muru
    muru over 1 year

    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.

    • Admin
      Admin over 9 years
      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?
  • codeape
    codeape over 9 years
    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
  • Merlijn Sebrechts
    Merlijn Sebrechts about 9 years
    This is exactly the same, just in two lines instead of one...
  • Merlijn Sebrechts
    Merlijn Sebrechts about 9 years
    How can you download ntlmaps when you have no internet connection because you need to connect to a proxy?
  • octavian
    octavian about 9 years
    It works for me if I use quatation marks. Without it doesn't...
  • JFA
    JFA almost 9 years
    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.