Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Thanks for your help previously. I have now set my Pi up as a web server and when I go to remotely connect via SSH in FileZilla (OS X), I get the following errors when attempting to add/remove a file in certain directories:

Response:   200 Type set to A
Command:    PASV
Response:   227 Entering Passive Mode (192,168,2,4,190,243).
Command:    STOR index.php
Response:   550 index.php: Permission denied
Error:  Critical file transfer error
Status: Disconnected from server

Help please! :)

I'm trying to get in to the /var/www/ directory and add files here. Tried various types, and this is where I should upload my web server files.

I'm running Wheezy OS on my Raspberry Pi.

share|improve this question
I think the directory permissions do not allow you to write files in this directory. You have two options: 1. Open up this directory for writing (and the parent directories), this is NOT the best idea, 2. Configure FileZilla to use a different directory to store it's files, for example a separate (new) directory in the /home tree might be a good choice. – ikku Dec 27 '12 at 19:56
How would I do that? I only got my Raspberry Pi on Christmas Day so I'm not an expert... Preferably opening up the directory for writing? – user4039 Dec 27 '12 at 20:16
The commands to change file / directory permissions is 'chmod', here you find a little info about this command, more in depth information can be found here – ikku Dec 27 '12 at 20:47
Could you check out the post below please, @Ikku? :) – user4039 Dec 28 '12 at 13:02

It looks like your SSH user doesn't have write permission to /var/www, I'm guessing you are using pi@raspberry ip to connect SFTP. If you want to write there, you can simply run (assuming you have a user named www-data to represent your webserver):

  • sudo chown -R www-data:www-data /var/www (This one gives /var/www to www-data user/group)
  • sudo chmod -R 664 /var/www/ (This one lets group users read/write, everyone else only read)
  • sudo useradd -G www-data pi (Adds your user to www-data group)
share|improve this answer
With 664 I got a 'Forbidden' error. I tried 777 and now I get this when trying to connect... Status: Waiting to retry... Status: Connecting to 192.168.x.x:21... Status: Connection attempt failed with "ECONNREFUSED - Connection refused by server". Error: Could not connect to server – user4039 Dec 28 '12 at 12:49
Not being a FileZilla expert :), I just searched for the error message online and found the following links that might be useful: FileZilla Forum and one on Stack Overflow that eventually links to the network config documentation. All the info in there suggests it might have something to do with the network config of filezilla or a router or some firewall. – ikku Dec 28 '12 at 13:27

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.