How to use wget behind a proxy – TechRepublic

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.

securityhacker-istock.jpg

Image: iStock/iBrave

More about cybersecurity

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:

Attackers combine proxy shell divots and attack Microsoft Exchange / Market Research Telecast
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...
Mobile Proxies: What You Need To Know - Eminetra.com
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...
1 / 4 of UK Parents Apply Content Filters from High speed ISPs - ISPreview. corp. uk
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...
Is there a difference between a web proxy and proxy server? guidebook AndroidGuys
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...
10 best proxy server services (free & paid) in 2021/2022 - FingerLakes1.com
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...
Fix Discord Connection issues on Windows PC - TWCN Tech News
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 ...
How to use a VPN on PS4 or PS5 - The Loadout
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...
You should VPN: How to choose the best VPN? - Augusta Free Drive
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 1 . 12 learns which keeps things local, gets some sort of grip on TCP probes • DEVCLASS - DevC...
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 - Alphr
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...
Why are some investors still supporting the dying fossil fuel economy? - Royal Dutch Shell plc .com
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 ...
LogMeIn preventing access to online banking - Virus, Trojan, Spyware, and Malware Removal Help - Ble...
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 ...
North America Cloud Content Delivery Network (CDN) Market is the key contributor to the global marke...
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...
AVG Secure VPN - Unlimited VPN & Proxy Server Version 2.16.5648 Steps Up Quality - Optic Flux
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...
KTM Movies 2021: Free Movies and Web Series Downloading Platform - The Bulletin Time
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
Envoy Proxy Server Project Comes of Age - DevOps.com CLOSE Our website uses cookies. By continuing to browse th...
Investigators Demonstrate New Way to Spot MITM Phishing Kits during Wild - The Hacker News
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...
Researchers Submit Patent Application, “Managing Queries With Data Processing Permits”, for Approval...
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...

IP Rotating Proxy Onsale

SPECIAL LIMITED TIME OFFER

00
Months
00
Days
00
Hours
00
Minutes
00
Seconds
First month free with coupon code FREE30