I just uploaded a bunch of files to my server and none of them uploaded with proper permissions. How can I ensure that by default any files uploaded get uploaded with 775 permissions unless I adjust them manually?

I never had this problem when I was hosted on cPanel, so it comes as a bit of a surprise.


Files/Folders I just uploaded ended up with the following permissions...

Folder: drwx--S--- 3 source ftp 4.0K 2010-10-09 13:19 article

File: -rw-rw-r-- 1 nobody ftp 319 2010-09-27 01:48 link.css

I'd like for folders to be 775 and files to be 664


You don't comment on the technique used for uploading the files. FTP? SSH/SFTP? rsync?

If it's FTP (as suggested by the group ownership) then you use the "umask" command in the FTP client. On its own, it should report the current umask, which is simply the server-provided default. "umask 002" in the client, before uploading. Or in the FTP server config, and be sure to restart the server after that.

If it's still not working, some information about the software you're using (server and client side) would help.

  • Dangit... I use VSFTPD, do you know how I can modify the umask? – Webnet Oct 10 '10 at 22:36
  • I didn't, but I used Google(vsftpd) to find the home-page, which linked to the online man-page and then I searched within that for "umask". vsftpd.beasts.org/vsftpd_conf.html It looks as though you want to change local_umask from its default value of 077 in /etc/vsftpd.conf – Phil P Oct 13 '10 at 21:34
  • Change it from 077 to 0775 ? – Webnet Oct 16 '10 at 20:34
  • No, 002. The umask is a bit-wise mask applied against the permissions with which the file is opened for creation and strips away some bits. So typically a file will be opened 0666 (rw-rw-rw-) and the default of 077 is stripping away the group/other permissions, just leaving the user permissions. 002 will strip away the other-write, and only the other-write. – Phil P Oct 28 '10 at 19:42
  • Directories in vsftpd are always created with 0777, so the umask is the only control available. Per your request, rephrasing, you only want to strip away other-write, whether for directories or files. So just setting local_umask=002 in /etc/vsftpd.conf should do it. – Phil P Oct 28 '10 at 19:54

You could use something like incron to detect creation of new files and change their permissions.


If you have root access to your server you could change your umask to be 002, which would default all directories to 775 and all files to 664.

  • I changed it, lets hope that works! – Webnet Oct 7 '10 at 2:03
  • Doesn't appear to have worked.. – Webnet Oct 9 '10 at 19:55
  • What FTP client are you using to upload your files? – Daemon of Chaos Oct 10 '10 at 15:28
  • SmartFTP, the latest version – Webnet Oct 10 '10 at 22:34
  • Did you change the umask on your server within your FTP server or just within SSH? They are exclusive only to their particular connections. – Daemon of Chaos Oct 11 '10 at 14:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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