If wget is your go-to download command on your Linux servers, and your machines are behind a proxy, Jack Wallen has the solution to get this setup working properly.

Image: iStock/iBrave
The wget command is one of the best ways to transfer files from a remote server to a local machine without a GUI. I use this tool constantly on Linux servers and it never fails to pull down the files I need. Unless I’m behind a proxy. When that’s the case, if you simply issue the standard wget command, you’ll receive errors and the file in question will fail to download.
What do you do?
Fortunately, the developers of wget considered this and built in the necessary options for using the tool when behind a proxy.
You might think it’s as simple as issuing a command like:
wget --proxy=PROXY FILE
Where PROXY is the proxy server you’re machine is behind, and FILE is the name of the remote file to download. That’s not exactly how this works. Fear not, I’m going to show you how to make it possible.
SEE: Security incident response policy (TechRepublic Premium)
What you’ll need
How to configure wget for a proxy
To allow wget behind a proxy, you must edit a configuration file and add the necessary addresses. The best way to do this is via the global wget configuration file. To open the configuration file for editing, issue the command:
sudo nano /etc/wgetrc
In that file, you’ll find three lines:
#https_proxy = http://proxy.yoyodyne.com:18023/ #http_proxy = http://proxy.yoyodyne.com:18023/ #ftp_proxy = http://proxy.yoyodyne.com:18023/
You’ll need to uncomment (remove the # character) each necessary line for your proxy. If you are behind both HTTP and HTTPS proxies you’d configure those lines like:
https_proxy = HTTPSPROXY:PORT http_proxy = HTTPPROXY:PORT
Where HTTPSPROXY is your HTTPS proxy server address, HTTPPROXY is your HTTP proxy address, and PORT is the required port for your proxy. Save and close the file.
There might be a situation where you don’t want all users to be able to get beyond the proxy. For that, you could set the proxy variables in a specific user’s .bashrc file. For that, you’d open the file for editing with the command:
sudo nano /home/USER/.bashrc
Where USER is the username.
At the bottom of the file, add the following:
export http_proxy=HTTPPROXY:PORT export https_proxy=HTTPSPROXY:PORT export ftp_proxy=FTPPROXY:PORT
Where:
- HTTPSPROXY is your HTTPS proxy server address
- HTTPPROXY is your HTTP proxy address
- FTPPROXY is your FTP proxy
- PORT is the required port for your proxy
Save and close the file.
Finally, if your proxy requires user authentication, the configuration lines would look like:
export http_proxy="http://USERNAME:[email protected]:PORT" export https_proxy="http://USERNAME:[email protected]:PORT" export ftp_proxy="http://USERNAME:[email protected]FTPPROXY:PORT"
Where:
- USERNAME and PASSWORD are the credentials used for proxy authentication
- HTTPSPROXY is your HTTPS proxy server address
- HTTPPROXY is your HTTP proxy address
- FTPPROXY is your FTP proxy
- PORT is the required port for your proxy
At this point, you should be able to use wget, in the usual method, without the proxy preventing you from downloading the file.
Subscribe to TechRepublic’s How To Make Tech Work on YouTube for all the latest tech advice for business pros from Jack Wallen.
Also see
Source of this news: https://www.techrepublic.com/article/how-to-use-wget-behind-a-proxy/
Related posts:
Management should update Microsoft Exchange outcome of attacks. After successful disorder, attackers can execute known dangerous code. Security updates have been used since May and July. After...
Proxies are the connective tissue that makes the world wide web an expansive, safe, and feature-filled place. If it weren’t for proxies, not only would connections between clients and servers be slow...
A new Ofcom report has found that 61% of parents are aware of the existing network-level internet filtering (Parental Control) tools provided by big U broadband ISPs, yet singular 27% have a...
If it turns out you‘re interested in boosting your digital security, you might want to try out one proxy. In general, these some other can keep your data safe from cyber attacks, enhance your p...
Your online activities are not saved on your computer when utilizing a proxy server; instead, they are sent to the proxy server. It improves the security and anonymity of your web browsing.However, b...
Apart from connection errors that is usually listed in the Console Log when you encounter Discord errors, there are general Discord connection issues that you might face while gaming on your Windows ...
As gaming consoles become more advanced, we find ourselves using them for more things beyond simple gaming. With built-in browsers and apps allowing us to do most things that we might also do on a ga...
In print Tuesday, Sep. 14, 2021, 11: 00 am Join the system AFP's 100, 000+ proponents on Delicious Sale made a request to AFP Subscribe to AFP podcasts on iTunes and after that Spot...
Istio security Service mesh Istio has grown to be available in version 1 . 12, providing users with innovations meant to make the project other extensible and secure. Istio 1 . 12 offers ...
How To Change your Location and Local Stations in YouTube TV Get Secure with ExpressVPN and Get 3 Months Free! Download Now Disclaimer: Some pages on this sit...
independent.co.uk Clean energy is the future – so why are some investors still supporting the dying fossil fuel economy? Institutional forces continue to prop up the fossil fuel economy, while ...
My Windows 10 home network consists of a Ryzen 7 and a 4770K both used for music, movies, TV, internet. Also 4 headless boxes just used for 3D rendering using Cinema 4D. All pcs had Windows Defender ...
A cloud content delivery network (CDN) is a cloud-based globally distributed network of proxy servers installed in multiple data centers. The goal of cloud CDN is to ensure faster delivery of conten...
The 21st century marked a huge advancement in terms of technology, both hardware and software. When you look at the programs that we used 20 years ago and how they looked like, you will likely wonder...
Liana Liberato KTM Movies 2021: Free Movies and Web Series Downloading Platform There are lots of illegal piracy websites on the internet today. And it is almost impossible to block all the illegal p...
Envoy Proxy Server Project Comes of Age - DevOps.com CLOSE Our website uses cookies. By continuing to browse th...
No fewer than 1, 230 Man-in-the-Middle (MitM) phishing world wide web have been discovered as looking for popular online services are fond of Instagram, Google, PayPal, Later on, Twitter, and L...
Insurance Daily News 2021 NOV 01 (NewsRx) -- By a News Reporter-Staff News Editor at Insurance Daily News -- From Washington, D.C., NewsRx journalists report that a patent application by the inv...