Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

I have a Server running Ubuntu 12.10 x64, and the last version of vsFTPd.

My user has its home folder set on /var/www/,

I created a public_html folder inside and gave 777 permisions to it, and removed the writing permissions of the home user folder. Everything is working well but:

Every file I upload by FTP (using SmartFTP) gets a chmod of 0.

My vsftpd.conf had only one line related:


I've tried to change to:


So my files would get 775 as soon as uploaded.

But only my uploaded folders are getting 775 permissions.

My uploaded files get 1411 permissions

Can someone help me solving that?

share|improve this question
you must to give permission to the FTP user. – Gex Feb 18 '14 at 0:56

I ended up using


on the vsftpd.conf. The problem was that both FTP user and www-data user needed permissions to write, so i had to join www-data and ftpuser to www-data usergroup, and CHMOD -R 775 all the files on /var/www - that way, with 775 CHMOD, the group would have permission to read, write and execute. Now its working perfectly.

share|improve this answer
up vote 2 down vote accepted

Got my answer:

As the www-data is the user responsible for the webserver and your normal user is responsible for the ftp server, you need first to make them both members of the same group: the group www-data.

creating custom user: useradd –d /var/www/ -g www-data -m yourusername this way the home directory will be the /var/www/ and your user will be in the www-data group.

after this, change the user pass by typing passwd.

Then, you need to create a public_html folder inside your yourusername home folder, as the FTP wont be able to write in the root of your home folder, you have to create a subfolder.

Remove write permissions of your yourusername folder Chmod a-w /var/www/

Then, apply new permissions for the subfolder: Chmod -R 775 /var/www/ (note you must use 775 chmod because you need group write permissions, not user write permissions, as you want the whole group (ftp and www-data) being able to write) Then, own the folder for the www-data Chown -R www-data:www-data /var/www/

That way you must be able to use FTP and have a Webserver working.

Good luck!

Funny as this info is so hard to find. Isnt people sharing knowledge anymore?

share|improve this answer

I also had problem like the file permission is changed when i upload a file through my ftp. This is fixed with one line change in my vsftpd.conf

local_umask=val(like 022,007,etc.,)

share|improve this answer
Care to improve and open this a little bit? Why is this better than the previous alternatives and what does it actually do, since this kind of syntax is not described in the manual page at all: local_umask has to be single value, and it must have 0 as a prefix for octal value. – Esa Jokinen Mar 28 '15 at 12:31

you need to change the ownership of that file:

chown root:root /home/username
share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.