Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By Davidchristy on
Hello,
Right now, when my twig files are created, they are made with 777 permission, when I really want them to be read only, at 444. How would I go about changing the permissions the files are created with?
Comments
This isn't really a Drupal
This isn't really a Drupal question, it's a server question.
I know it is possible to go
I know it is possible to go in after the fact and change the file permissions, but I'm wondering if there is a way to make it so the files get created as read only. Or would this be done on a server level as well?
Yes, this is done at the
Yes, this is done at the server level.
How?
So, I wanted to ask some sys-admins a bit higher than me first, but none of them could figure out the problem on the server end. How were you thinking this could be done on the server?
To clarify, I don't just want to use chmod to go in and change them every time, I want the starting permissions to be set lower.
PS, you can private message me if this is a server problem and not a code problem.
I'm not a server guy overall,
I'm not a server guy overall, though I'm fairly proficient with (Unix) servers.
You can use umask to set up default file permissions for a directory. Here is a bit of reading on that: https://www.cyberciti.biz/tips/understanding-linux-unix-umask-value-usag...
However, a bit of reading shows me that it's not easy to set it up for a given file type, umask just gets all files in the directory. You can try reading this thread, and follow it's leads to see if you can find a solution that works for you: http://unix.stackexchange.com/questions/185745/set-default-permissions-b...
So umask is something I
So umask is something I looked into already my umask is set to 0002. I can see this when I log into the server through ssh and mkdir a new folder it gets made with drwxrwxr-x or 775, not 777 like my server claims the twig folders are being created with.