0

I am currently using this for my non-popular website:

sudo chmod -R 775 /var/www/html

And I have searched many hours on how to make newly created directories and files 775 - I've come across umask and GSID (CHMOD g+s...) stuff, but I don't know how to use those in my sudo chmod -R 775 /var/www/html

How do I make sudo chmod -R 775 /var/www/html for newly created files/directories in vsftpd? I get these permissions in newly created directories: drwx------ and files: -rw------- which means I can't do anything as a user and I want them to be (d)rwxrwxr-x; 775.

EDIT: umask 002 did not work, but I found out my "Owner/group" in my FTP shows as "33 33" on non-newly created directories/files when newly created ones are "1000 1000" what does that mean?

SOLUTION: Editing /etc/vsftpd.conf - making local umask=002, anon_upload_enable=YES, anon_mkdir_write_enable=YES and adding this at the bottom of the file: file_open_mode=0777

1

You can set

umask 002

And all new files will be created with 775 permission

If you like that the new files groupid will be equal to folder group I'd. You can for example change the folder group to be 1000 as the new files

  • It did not work - it's the same, but "owner/group" is 1000/1000 on my new files and directories when my other non-newly created files and directories are at "33 33" – Zecret Jan 17 '18 at 19:38
  • New files will be created with permission as defined in umask. The files ownership is depend on the user ID of the process which write them. – Yaron Jan 17 '18 at 19:42
  • So does owner/group not matter in my question? How do umask 002 not work for me then? I typed umask and it says 0002 is that why? – Zecret Jan 17 '18 at 19:43
  • 1
    @Zecret where did you change umask? if you are concerned with files created/uploaded over (vs)ftp, then AFAIK it is the local_umask and/or anon_umask in vsftpd.conf that you will need to modify: see for example Default owner/permissions of created files via VSFTPD – steeldriver Jan 17 '18 at 19:51
  • 1
    @Yaron. Exactly. Thank you for pointing that out. I find it always tricky to get it right because you have to think "backwards" with the umask. – PerlDuck Jan 18 '18 at 10:26

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.