
Today I had to configure my FTP server to apply 755 permissions to all newly uploaded files on the box. So, I am using VSFTP and referred to the online manual for more information regarding the exact directive that should be applied:
http://vsftpd.beasts.org/vsftpd_conf.html
Well, it is not the best manual ever, still, it gives most of the information that is required in a few words. To the point — in order to have all of your files uploaded to the server with permissions 755 you should add the following line in your vsftp configuration file:
local_umask=022
As it is explained local_umask is:
- local_umask
- The value that the umask for file creation is set to for local users. NOTE! If you want to specify octal values, remember the “0″ prefix otherwise the value will be treated as a base 10 integer!
Default: 077
By the default the configuration file of VSFTP should be in your /etc directory: /etc/vsftpd.conf. You can add the line anywhere in the file. Still, you should restart or reload the vsftp on the server in order to apply the changes and all active FTP sessions should be reconnected. Then, all uploaded files will be set withe 0755 permissions on your server.