Problem of using proxy with wget in Ubuntu [closed

2019-08-29 07:51发布

问题:

Please help me, I want to download file from dev.opennebula.org using command wget but I have a problem with proxy. Now, I have already set the http-proxy value in file /etc/wgetrc and I use command wget --proxy-username=username --proxy-password=password URL but the result is

Connecting to proxy.mmcs:8080 failed: Connection timed out.
Retrying.

I am sure that I set the proxy name and port correctly. How can I do and can I use other commands to download that file.

Thank you.

回答1:

Inside sudo gedit /etc/bash.bashrc add those lines:

export http_proxy=http://username:password@proxyserver.net:port/
export https_proxy=http://username:password@proxyserver.net:port/
export ftp_proxy=http://username:password@proxyserver.net:port/

Inside sudo gedit /etc/environment add those lines:

http_proxy=http://username:password@proxyserver.net:port/
https_proxy=http://username:password@proxyserver.net:port/
ftp_proxy=http://username:password@proxyserver.net:port/

Inside sudo gedit /etc/apt/apt.conf add those lines:

Acquire::http::Proxy "http://username:password@proxyserver.net:port";
Acquire::https::Proxy "http://username:password@proxyserver.net:port";
Acquire::ftp::Proxy "http://username:password@proxyserver.net:port";

Source: Ubuntu Linux Proxy Settings in company environment.



回答2:

Try --proxy-user instead of --proxy-username.



回答3:

Error message says "Connection timed out". For me that looks more like error in establishing the connection the the proxy and not in authentication.

I'd start by debugging following things:

  1. does proxy.mmcs resolv with "host" and can it be pinged
  2. does changing proxy.mmcs into ip address help ?
  3. can i telnet from same host that i try to run wget into the proxy server's port 8080.