I am new to linux and I installed linux for web server purpose with apache2. I have created a new directory /var/www/mysite. My main problem is that each new file I create has read only permissions 644 permissions using root user. I would like each new file created to have 775 permission. I am using FTP to update my files and simply each time I upload or create a new file I need to login via ssh and update permissions.

I read around that there is UMASK and some ways to change default permissions for groups/users but I am not quite sure what would be the best solution.

Thanks in advance for any help...

  • You upload your files using an ftp-client and the files you uploaded got permission 644 and are owned by root - is this your problem? If yes, please tell us which ftp-server you use on your host.
    – Wolfgang
    Feb 13, 2014 at 10:34
  • We use vsftp.. that is indeed our problem
    – nimi
    Feb 13, 2014 at 11:07

1 Answer 1


Yes, if you upload files by ftp the file permissions usually get set by the ftp server. For vsftp see http://ubuntuforums.org/showthread.php?t=1570700 for a real "short", similar question and/or https://security.appspot.com/vsftpd/FAQ.txt (search for umask) for a "long" version.

Q) Help! Uploaded files are appearing with permissions -rw-------.

A1) Depending on if this is an upload by a local user or an anonymous user, use "local_umask" or "anon_umask" to change this. For example, use "anon_umask=022" to give anonymously uploaded files permissions -rw-r--r--. Note that the "0" before the "22" is important. A2) Also see the vsftpd.conf.5 man page for the new "file_open_mode" parameter.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .