Ubuntu: FTP/SFTP not allowing any writing


I'm using Ubuntu 14.04 and vsftpd. In the past my account (not root) has had full access, more or less, to either FTP or SFTP to anything on my server and edit any file that my user account could edit. Now, recently, I cannot edit anything, only view. As a specific example, I cannot upload to /var/www even though my user is a member of the www-data group and that group owns the files (file/folder permissions are correct).

I'm not terribly familiar with vsftpd and how it works. I mainly need to be able to FTP or SFTP to my /var/www directory to edit my website. What could be my problem?

EDIT: The specific error message when using FTP is 553 Could not create file.


You should be able to change the permissions (by terminal on the machine or over SSH) by running this so that users other than root can access it:

sudo chmod -R 757 /var/www  

or this so that it is owned by your user (which should be defined by $USER):

sudo chown -R $USER:$USER /var/www  

You need to do this as only the owner+group can read, write and execute in /var/www, but other users can only read and execute - including the user you are using to try and the folders.

For more info, look at man chmod and man chown

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »