Hosting -- Folder and File Permissions

Dear community

I’ve got quite a general question. In Upgrade manually — Nextcloud latest Administration Manual latest documentation, they are writing that all folders should be on 750 and all files on 640 permissions.

But in my hosting, the provider sets them by default to 755 and 644. It seems now also that - while having it set to 750 and 640 -, it does not work to use Nextcloud.

Could it be that setting it to 755 / 644 is fine too? What about my data directory which is a subdirectory of the nextcloud root currently.

I’ve just had an advanturous update from version 32.0.3 to 32.0.5. Something did not work with the integrity check while using the occ / gui way of updating, so I had to copy data and apps as well as config.php manually into a fresh installation of 32.0.5. Now, I’m not sure about the permissions anymore.

Thanks a lot

Axylo

Can you be more specific than “does not work”?.What happens precisely?

As for the permissions, well, in shared hosting environments many odd setups are possible. Your hosting provider may be able to provide better guidance as to how they’ve set up their PHP environment.

At the same time, opening your data directory up to 755 could expose it to other users on the same host.

Sorry, you’re right.

By “it does not work”, I mean issues with accessing Nextcloud at all by getting 404 errors.

But, if between 644 and 640 / 755 and 750 there is only a difference how it’s presented on the server itself, I’m not worried. I was afraid that this could affect accessibility of the data folder from public. Other forum posts mention that you can try by just accessing nextcloud.domain.my/data and if you get a 403 (obviously by .htaccess), it should be fine. Is that correct and all I must check to protect from crawler/public access?

Yes, generally. Also there are built-in setup checks for that type of problem as well. They’d be visible under Admin settings->Overview.

Ok, great, thanks. As well, I used to check myself often with this one here: Nextcloud Security Scan

Thanks for the gentle help!