Debian http_proxy setting

Need to set a HTTP proxy within a Debian system ?

Assuming your proxy server is on 192.168.0.1 and listening on port 3128, then the below may help …

( If you need authentication you can use username:password@ like you would in an old style web browser – e.g. http://username:password@192.168.0.1:3128. )

/etc/profile.d/proxy.sh

Add /etc/profile.d/proxy.sh containing

export http_proxy=http://192.168.0.1:3128

/etc/apt/apt.conf.d/99HttpProxy

Add /etc/apt/apt.conf.d/99HttpProxy containing

Acquire::http::Proxy "http://192.168.0.1:3128";

/etc/wgetrc

Edit /etc/wgetrc and add

http_proxy = http://192.168.0.1:3128

(some system commands rely on wget, and may not otherwise use an environment variable, e.g. debootstrap; the http_proxy setting should be present by default but commented out).

(This is all, in a round about way, relayed to the http proxy security vulnerability announced in July 2016 – see httpoxy.org for more info)


Posted

in

,

by

Tags:

Comments

21 responses to “Debian http_proxy setting”

  1. Bhikkhu Avatar
    Bhikkhu

    Hello David,

    thanks for this.

    Also something small, a typo at
    Acquire::http::Proxy “http://192.168.0.13128”;

    shouldn’t be? (semicolon missing?)
    Acquire::http::Proxy “http://192.168.0.1:3128”;

  2. David Goodwin Avatar

    Thanks ! typo fixed…. 🙂

  3. DanielS Avatar

    Thanks so much for this! Everything is working as expected! Was looking for the locations for jessie, so glad you shared!

  4. Lincoln Avatar
    Lincoln

    hello, I’m started my first debian system, and, when I installed, he said that ” I you want to go outside… u need to setup you debian proxy? Is that right?
    Well…
    I need to use my username:password@ipv4(conection with internet)

    Am I right?

  5. David Goodwin Avatar

    If you need to authenticate, I’d expect it to be something like http://username:password@hostnameOrIpAddress

  6. Ramesh Avatar
    Ramesh

    Dear Debian Experts,
    Recently I have added proxy setting as you mentioned in earlier mailto some one. I am facing problem on app installation particularly fsl (or any other apps) which is given below. Same problem happens even after as root.

    brain@neurodebian:~$ sudo apt-get install fsl-5.0-complete
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    E: Unable to locate package fsl-5.0-complete
    E: Couldn’t find any package by regex ‘fsl-5.0-complete’

    Please help me to solve this problem.
    Thanks in advance
    Ramesh

  7. vera Avatar
    vera

    thanks a lot it was short and useful 🙂

  8. David Goodwin Avatar

    did you run apt-get update first?

  9. Manuel Frank Avatar
    Manuel Frank

    Thank you so much. I struggled hard until I found this 🙂

  10. Lian Avatar
    Lian

    Hi, i’m trying to use wget through a proxy and i’m following all these instructions, but my username has a ‘@’ in between, it’s like: ‘user@domain’. So the configuration line goes like :
    http_proxy = http://user@domain:password@server:port.
    And it gives me an error on the port number, How can i fix this?

  11. David Goodwin Avatar

    Tried escaping the username @ with a \ ?

    ( ….ttp://user\@domain:password@server:port … ?)

  12. Lian Avatar
    Lian

    Yes, i’ve tried escaping the @, but it gives me the error of the port number

  13. Stephane Avatar
    Stephane

    You have to replace the @ in username by %40

  14. Stephane Avatar
    Stephane

    It also works for special characters in password 🙂
    here is a list of character encoding : https://grox.net/utils/encoding.html

  15. David Goodwin Avatar

    Stephane – Thank you 🙂

  16. Phil Millard Avatar
    Phil Millard

    Many thanks – got this working on a Debian Wheezy VM of Nervepoint Access Manager. All updating well now.

  17. Lubrito Avatar
    Lubrito

    Thanks! It helps a lot! 🙂

  18. J T Avatar
    J T

    Also work for Raspberry3B.

    Many thanks

  19. […] Trato de configurar un proxy para debian:jessie imagen, pero yo no la hacen. Yo sigo este enlace . Aplico todos ellos con el gato de la etiqueta (por ejemplo: “el gato > proxy.sh” […]

  20. Vel Avatar
    Vel

    Thanks a lot. Very useful:-)

Leave a Reply

Your email address will not be published. Required fields are marked *