Skip to content

/errors/wget/error-403-forbidden

wget: ERROR 403: Forbidden.

The commands on this page have not been executed by our verification runner yet.updated
tool
wget
exit code
8
versions
GNU Wget 1.x
os
linux, macos, windows

ERROR 403: Forbidden. means wget reached the server and the server answered HTTP 403: it understood the request and refuses to serve it. wget saves nothing and exits with status 8 (server issued an error response). Nothing is wrong with wget or the network; the server wants something the request did not carry, typically credentials, a cookie, a Referer, or a different User-Agent. Open the URL in a browser with the same network to see whether it is public at all.

What the output looks like

wget prints the status line it received, then the error with a timestamp (format from src/http.c):

text
HTTP request sent, awaiting response... 403 Forbidden
YYYY-MM-DD HH:MM:SS ERROR 403: Forbidden.

The response text after the code comes from the server, so a server can send other wording after 403. See the full request and response headers with -S (server response) or -d (debug):

bash
wget -S -O /dev/null https://downloads.example.com/file.zip

Fixes by cause

CauseWhat to send
Login required--user=NAME --ask-password, or --header="Authorization: Bearer TOKEN"
Session cookie required--load-cookies cookies.txt (Netscape format, exported from the browser)
Hotlink protection--referer=https://www.example.com/page-with-the-link
User-Agent filtering-U "MyTool/1.0 (contact@example.com)" or the agent string the site documents
Expired signed URLrequest a new link; signed URLs from S3 or a CDN stop working after their expiry time
bash
wget --referer=https://www.example.com/downloads/ \
     -U "release-sync/1.0 (ops@example.com)" \
     https://www.example.com/files/release.tar.gz
  • ERROR 404: Not Found.: the path does not exist on the server; wget also exits with status 8.
  • With curl, the same response gives no error unless you use -f; then curl exits with code 22.

Sources