Please change the permissions to 0770

Hi, I’m getting hundreds of email from the cron:

Cron root@box sudo -u www-data php -f /usr/local/lib/owncloud/cron.php

Your data directory is readable by other users
Please change the permissions to 0770 so that the directory cannot be listed by other users.

When I change the permission of my data directory to 770, then I cannot access my email anymore.
Is there a way to stop the cron from sending me those email?

I tried to change the permission to something else, but seems that only 777 or 775 is working.

This is the same server where you set the permissions on everything in the MiaB directory to the same permission?

Not exactly.

I Just want to not have that Cron error. Which folder exactly needs to have permission 770? for this Cron.php to stop sending email?

I don’t have netclould installed, I don’t know why I started getting these errors about the permission.

Since I don’t have netcloud installed when looking in the Cron.php code it should exit, but for some reason MIAB things it’s installed and send me those errors.

/usr/local/lib/owncloud/cron.php

// Don’t do anything if Nextcloud has not been installed
if (!$config->getSystemValue(‘installed’, false)) {
exit(0);
}

Maybe I should just exit(0); at the top of this cron.php file?

You removed Nextcloud from MiaB?

You can see that I don’t understand what is the issue, and which permission I need to change on which folder so I don’t receive those Cron error anymore.
I didn’t uninstall anything, I though Nextcloud was an external service, and I don’t use any external service the installation is the default installation.

The Nextcloud data directory is in the MiaB folder ../owncloud/. The folder should be owned by www-data:www-data with 770 permissions and subfolders have 755. Everything in the folder is owned by www-data:www-data, config.php is 600, nextcloud.log is 640 and it looks like the rest of the files are 644.

This is the error that I’m trying to fix.
I get this from a fresh install. Without doing anything in the permission.

Is there anyway to remove this error?

What is the user for MIAB which I need to give access to a directory?
I also cannot find this config directory.

Thank you very much I will try that.

If you haven’t discovered this already, here is one way to change only files or only folders in all subdirectories using find piped to xargs:

Directories:

# find owncloud/ -type d | xargs -d chmod 755

This may change the owncloud directory to 755, but just change it to back to 770.

Files:

# find owncloud/ -type f | xargs -d chmod 644

This will change also set 644 on config.php and nextcloud.log, but just change them back.

This is great thank you so much.
Can I apply this also on the “mail” folder?
Or maybe on the entire MIAB data folder?

You have to know that every file or every directory in all of the subdirectories requires the same permissions. When using directories or files that have spaces in the name, you may get errors and either change the permissions for each one or add \n before chmod:

# find owncloud/ -type f | xargs -d '\n' chmod 644