Write permission issue

Hello there; It is necessary to allow continuous writing to the directory below. I do not know the reason for updating or occasionally write permissions are reset. I have to give write permission on the first installation.

home/user/tmp

hey hakikatihak, it is neccessary that you provide more details on what you are trying to achieve.
usually the permissions provided out of the box are sufficient, so the question is rather who or what needs access to that folder which is not covered by the original permissions :wink:

Hello there; When the directory I mentioned is updated, the write permission changes. i’m doing chmod 1777. it becomes 0644 again. here php session files are stored. Cannot start session without write permission. I often have to fix this problem.

you should not interfere with the permissions on that folder at all. the default is:

drwxrwx–x 2 user user 4.0K Mar 19 06:25 tmp

I’d assume you also wildly changed permissions or owners on other files and folders, which then messes up other things. don’t do that. don’t misuse chmod/chown but instead fix the real problem.

out of the box in Hestia, php session files can be written to that folder without any changes.

1 Like

According the code it should get 755/drwxr-xr-x as default permission

Thanks for your help

When I create a new user the permission is set to drwx------.
I haven’t changed anything since the first installation. Could this problem be missed for me?

drwx------ 2 admin admin 36864 Mar 24 13:06 tmp

@hakikatihak you want to check what owner is set for your php files. in general php is configured to run as the owner of these files (which should be the user itself) and that one is also the owner of the tmp file and therefore allowed to write.

there are only two cases where this might fail:
a) your php-files belong to the wrong user (see above)
b) you use php via apache mod-php and are missing an apache module like mod-ruid2. we had a case lately where this package was missing on an ubuntu package. could be an issue with the ubuntu installer. you could try to run apt install libapache2-mod-ruid2 to get it installed and activated and see if this solves your problem.

in any case as said before, changing the permission of the tmp dir is no solution for the problems cause :wink:

When using vestacp there was a code snippet that regulates automatic permissions. Is there such a thing for Hestia.

bash <(curl -s https://gist.githubusercontent.com/lukapaunovic/a773ad1fe49a477f4a7717a875d839d7/raw/3bb8c57a4c605d3e598cd97b669293fd18fd8c02/v-fix-websites-permissions)

For the vestacp I gave above, I edited the solution for hestiacp. The problem seems to be solved. I leave the link below to help others. The code below worked and I would be glad if you can confirm it. Thanks for your help.

Solution;

bash <(curl -s https://gist.githubusercontent.com/civata/59c9df831f204a1ad706c5dcbb970541/raw/487b12f5893dabecc4c6dd58186a2a81a47887cc/v-fix-websites-permissions)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.