- Forums
- Linux
- Wget Error Says Permission Denied Cannot Write To
This is an error I am getting when I tried two send the wget command in my linux server. I will show you how to solve this problem by using one simple shell command just follow these instructions [4490], Last Updated: Mon Jun 24, 2024
webune
Mon May 11, 2015
1 Comments
8117 Visits
i just started a lamp deployment on google cloud and i was trying to transfer some file form my old server using wget, so this is the command i sent:
root@myserver:/var/www/html# wget http://example.com/file.zip
this was the output
--2015-05-12 02:55:09-- http://example.com/
Resolving tuiz.com (tuiz.com)... 150.263.248.110
Connecting to tuiz.com (tuiz.com)|150.263.248.110... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [zip]
index.html: Permission denied
Cannot write to `file.zip' (Permission denied).
I am not going to bored you with all the details but I am to tell you how I was able to solve this.
As you can see from my command, I am sending this command from the html directory and I am logged in as root, so why do I have permission problems when im already logged in as root?
When I got this error it didn't make sense because it the same permissions but I am already logged in as root.
After researching I found a way to make it work
Simply move to the temporary directory and the send the command from the GNP directory
cd /tmp
now resend the wget command and you will see that it works. in the past, if didn't have to go to the tmp directory. i was using CentOS, and now i am using Debian. maybe its a Debian thing.. i dont know.??
these are my configurations.
Source image
debian-7-wheezy-v20150423
permission:
Permissions
User info
Disabled
Compute
Disabled
Storage
Read Only
Task queue
Disabled
BigQuery
Disabled
Cloud SQL
Disabled
Cloud Datastore
Disabled
Cloud Logging
Write Only
Cloud Monitoring
Disabled
Cloud Platform
Disabled
ipsconfig
linux apache mysql php
chattr -i /var/www/clients/client1/web1
and put back the original permissions
chattr +i /var/www/clients/client1/web1