Connect it to a NFS-Share via External Storage App (Share is mounted locally on the FS, user www-data has access to it)
Write and read files with a user with the correct UID / GID on the Storage Provider (NAS)
I have setup everything so far.
The only thing is, that I cannot write and read the files with the “correct” user.
So my first idea was, that I can set the correct UID and GID of a user and it would be mapped correctly to the NFS-Share.
Question: Is there a way to set the GID / UID of the user that nextcloud uses to access the NFS-Share?
If I use AD / LDAP, is the problem solved then? Would that be the only way to achieve that?
Is it really correct. Can your Nextcloud user write? Test with this command (e.g. user www-data) sudo -u www-data touch /path/to/your/nfs-share/testfile.txt
(touch creates an empty file here testfile.txt)
sorry for replying so late.
Yes, www-data can write.
The reason why I ask: If I mount a share with NFS, all files that will be created there via NextCloud are owned by www-data and I would like to set the correct UID of the user that I have on both sides. @devnull, “Really Correct” means, that this is solved by using LDAP/AD? Maybe you can explain a little bit more in detail?
So… maybe I have to correct me and describe my problem more detailed:
Technically, everything works since I configured it.
The only thing I do not like is the following:
Every file, that is created by NextCloud is created with the same user (Even www-data or the User I define in my NFS-Settings)
I wold like to have a solution where the user, that I use to write to the share is the same user that I have created on the storage.
So as far as I understood, NextCloud ALWAYS writes with www-data, even if I connect it via LDAP / Active Directory?
Is there no way of having a UID/GID Mapping?
How I can achieve, that the User and Group that write to the share is not always the same?