Hi,
I’m wondering how I can add the SAMBA users credentials in this command:
sudo -u www-data php /var/www/nextcloud/occ files:scan --all
When I run it it just says permission denied at the samba cache and it’s because that I need to add the credentials for the samba user, how can I do that?
Scanning files for 4 users
Starting scan for user 1 out of 4 (xxx)
mkdir failed on directory /var/cache/samba: Permission denied
mkdir failed on directory /var/cache/samba: Permission denied
mkdir failed on directory /var/cache/samba: Permission denied
mkdir failed on directory /var/cache/samba: Permission denied
mkdir failed on directory /var/cache/samba: Permission denied
and it keeps going.
I’m currently using a domain I guess that many people are using it so it should be good to have in the docs how to add the credentials with and without domain joined SMB share.
Without knowing the particulars of your setup, I’m baffled as to why the www-data user is even attempting to modify this folder during a scan. It should be talking to the Samba daemon via CIFS, and letting the smbd daemon handle this folder. The files are shared once via Samba, then is Nextcloud configured to share them using External Storage -> SMB/CIFS (through Samba) or External Storage -> Local (mess with the files directly)?
Here would be how you can allow www-data to make changes in that folder, though I’m not sure that’s what should happen here.
First, add www-data to the sambashare group:
The more I look into it, the more this seems to be a Samba problem rather than with Nextcloud. Are you able to mount and access all your files via SMB to begin with?