Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I can set my proxy username and password along with proxy settings in the proxy ui but these settings do not work on the command line. How can I use apps such as wget & ping on the command line with a proxy?

Example Details:

  • username: 1234
  • pass: linux
  • proxy: proxy
  • port: 8080
share|improve this question
    
Take a look at this - tutorial on using wget with proxy –  nitstorm Jun 7 '11 at 5:30

2 Answers 2

up vote 7 down vote accepted

You can set the environment variable http_proxy.

In a bash shell, type this:

export http_proxy="http://1234:linux@proxy:8080"

To persist this configuration, you can add it to /etc/environment or /etc/bash.bashrc, /etc/profile or to an individual user /home/user/.bashrc

share|improve this answer
    
When I try to wget something it connects to the proxy server but then gets a 407 a says I need authentication –  consindo Jun 8 '11 at 0:32
    
wget should work using only the environment variable "http_proxy", but you can take a look at the link that @nitstorm posted. It says you can add proxy information to ~/.wgetrc –  Alex Jun 8 '11 at 20:37
    
If you did add that line to any of those files, you can unset your proxy by removing the same from them. –  Prasanth Dec 29 '12 at 18:15

You can't use proxies in the traditional sense with Ping. Ping works using the ICMP protocol.

HTTP proxies will only work with HTTP traffic. You can proxy most traffic in most programs using a SOCKSify-wrapper. The "dante-client" package provides a socksify. I used this one on other occasions: https://github.com/gr0gmint/transucks

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.