setting up http proxy at console

December 30th, 2006 mysurface Posted in Admin, export | Hits: 416724 | 31 Comments »

Setting up proxy at Firefox do not have effects at console, which means your wget, ssh, apt-get, yum etc do not access through the proxy you set at Firfox browser. To setup http proxy at console, you can do as bellow, assume the proxy IP is and port 3128.

export http_proxy=''

Remember, you have to specified http://, and to know more about export, check out HERE.

To clear your http proxy and use back yours, do this:

export http_proxy=''

31 Responses to “setting up http proxy at console”

  1. Cool!

  2. yep, but what about if the proxy requires authentication…. what would it be the workaround?

  3. export http_proxy=

  4. can u tell me how to view the http_proxy settings that already has been set ?

  5. echo $http_proxy

  6. how can I save the configuration in the console?

  7. Jaime Garcia Says:

    you can put the line in /etc/environment
    you can add same line into your .bashrc, in your home directory

  8. hi
    thanks for nice article
    can you say me how can i encrypt my password ?

  9. This doesnt work with Ubuntu 10.04. wget,apt-get dont respond even on setting appropriate proxy . For apt-get proxy has to be specifically set in /etc/apt/apt.conf … How to get it working with wget ?

  10. I agree with Balkrishna, this is not working in Ubuntu 10.04. I have tried setting in /etc/environment and ~/.bashrc , but no use.
    As mentioned apt-get is working after setting the /etc/apt/apt.conf

  11. put it into ~/.profile if you need that setting permanently per user. it does not depend on any shell you use or whether X is running.

  12. i agree with satyadeep, this is not working ubuntu 10.04 .

  13. New game: Staying one proxy site ahead of the work block list. Currently winning at life.

  14. My proxy make by ssh command and through the sock 127.1:9999
    Now how can I run wget?

  15. Thanks a lot for this!

  16. Gustavo Vegas Says:

    In order to get wget to work through a proxy, you need to set the proper variables inside your .wgetrc. Here is an example:

    Always be conscientious about the security of a file containing something like your password. Avoid having it written in the file if possible. If needed, make sure the file is only readable by you – e.g. chmod 500 .wgetrc.

    I hope this helps.

  17. What I have so far in my ~/.bashrc:

    export http_proxy=’’
    export no_proxy=’localhost,,,,′
    #export proxy_user=”
    #export proxy_password=”

    wget, lynx and links all work with all but the no_proxy local intranet exceptions. (Gentoo portage, perl CPAN, python easy_install, firefox, etc…)

    So far for most things that I want to NOT use the proxy I run the command like so:

    unset http_proxy;

    example: unset http_proxy; links ‘https://mysite.intranet.local/mylocalapp’

  18. @Gustavo Vegas – I don’t think that’s true. wget works fine with my system wide proxy settings

  19. Krishnaprasad Says:

    Thanks a lot,
    I reached this site after 4 hour search.

  20. Nice post. I used to be checking continuously this weblog and I’m inspired! Very useful info particularly the final section :) I deal with such information a lot. I used to be looking for this certain information for a very long time. Thanks and best of luck.

  21. Nice post, but when you the username contains an @ how do you do ?

  22. @Arnaud

    I found when using special characters you must use ASCII format.

    In my /etc/apt/apt.conf

    #Passwords with special characters:
    #EX. If using @ must replace using ASCII code %40. See the format below. The password is ‘p@ssword’.

    Acquire {
    Retries “0”;
    HTTP {
    Proxy “”;

  23. […] : Linux by examples -7.280931 112.788049 Share this:TwitterFacebookLike this:LikeBe the first to like […]

  24. Effortlessly Conceal Your IP Address – Just click “Conceal IP” and your IP is instantly hidden! Other people see a phony IP, which is not related with your real IP

  25. Hi Nick,

    thanks for the “%40” that was what I was searching for… :-)

    Cheers and have a nice one.


  26. Super interesting blog. I’ll be back.

  27. Remarkable! Its in fact remarkable piece of writing, I have got much clear
    idea on the topic of from this article.

  28. My brother recommended I would possibly like this website.
    He was once totally right. This put up actually made my day.
    You cann’t believe simply how much time I had spent
    for this info! Thank you!

  29. This post show to use cURL with P2P Proxy

  30. Great looking web site. Think you did a bunch of your very ownyour very own html coding
    nhl 17

  31. http://w.w.w/ ????????????! ??? ?????????? ?????????? ???? ?????? ??? ??????? ????? ??????? ? ??????

Leave a Reply