setting up http proxy at console

December 30th, 2006 mysurface Posted in Admin, export | Hits: 208697 | 27 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 219.93.2.113 and port 3128.

export http_proxy='http://219.93.2.113:3128/'

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=''

27 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=http://username:password@proxy.thing.com:8080/

  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:

    hi
    you can put the line in /etc/environment
    or
    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:
    http_proxy=proxy.host.com:8080
    ftp_proxy=proxy.host.com:8080
    proxy_user=MyUserName
    proxy_passwd=MyPassword

    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. @Gustavo Vegas – I don’t think that’s true. wget works fine with my system wide proxy settings

  18. Krishnaprasad Says:

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

  19. 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.

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

  21. @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 “http://username:p%40ssword@proxy.com:8080″;
    };
    };

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

  23. 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

  24. Hi Nick,

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

    Cheers and have a nice one.

    Marcus

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

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

  27. 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!

Leave a Reply