1

I am a Linux Ubuntu user and I have some problem setting the proxy on my entire system.

I go into the network settings of my Gnome and then I go to the Network Proxy settings mask and then I put my proxy for the HTTP Proxy* as Manual, then I click on the Applies to the entire system button, it ask me my password and it is finish

The problem is that if I open a shell, the network don't work and I can't ping anyting, infact I obtain only:

andrea@andrea-Studio-1555:~$ ping google.com
PING google.com (173.194.35.7) 56(84) bytes of data.

and the cursor still blink and don't go on...

Why? What can I do to go out with my proxy in the shell?

4
  • Are you sure ICMP is supported by your proxy? Try curl google.com. May 31, 2013 at 16:19
  • It give me: andrea@andrea-Studio-1555:~$ curl google.com <HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8"> <TITLE>301 Moved</TITLE></HEAD><BODY> <H1>301 Moved</H1> The document has moved <A HREF="google.com/">here</A>. </BODY></HTML> andrea@andrea-Studio-1555:~$ What this mean? ehat have I to do? May 31, 2013 at 17:05
  • the strange thing is that CURL seems work but I can't use apt-get and ping from shell, why? May 31, 2013 at 17:10
  • Yes, curl works. Ping may not be supported by the proxy but apt-get should work. Show the result for apt-get update. And use some pastebin like gist.github.com. Jun 1, 2013 at 13:07

2 Answers 2

1

Set http_proxy shell variable

Type the following command to set proxy server:

$ export http_proxy=http://server-ip:port/
$ export http_proxy=http://127.0.0.1:3128/
$ export http_proxy=http://proxy-server.mycorp.com:3128/

How do I setup proxy variable for all users?

To setup the proxy environment variable as a global variable, open /etc/profile file:

# vi /etc/profile

Add the following information:

export http_proxy=http://proxy-server.mycorp.com:3128/

Save and close the file.

How do I use password protected proxy server?

You can simply use wget as follows:

$ wget --proxy-user=USERNAME --proxy-password=PASSWORD http://path.to.domain.com/some.html

Lynx has following syntax:

$ lynx -pauth=USER:PASSWORD http://domain.com/path/html.file

Curl has following syntax:

$ curl --proxy-user user:password http://url.com/

try this information it may help you.

1

Try reading up about using a proxy in combination with Ubuntu here.

That you cannot ping is to be expected. A proxy server is for relaying (and caching) HTTP, HTTPS, FTP protocols. Each has to be configured separately. When you ping, it is utilizing the ICMP protocol. Most proxy servers don't allow this. Also, most proxy servers do the DNS resolving for you (translating the www.google.com to an IP address); the reason why you don't get anything else but that first line is because you cannot resolve the domain.

Follow the guide I gave in the beginning and try again.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .