/errors/wget/error-403-forbidden
wget: ERROR 403: Forbidden.
- 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):
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):
wget -S -O /dev/null https://downloads.example.com/file.zipFixes by cause
| Cause | What 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 URL | request a new link; signed URLs from S3 or a CDN stop working after their expiry time |
wget --referer=https://www.example.com/downloads/ \
-U "release-sync/1.0 (ops@example.com)" \
https://www.example.com/files/release.tar.gzRelated errors
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.