"Forbidden" when trying to upload files

I modified the skeleton folder then thought it would regenerate the folders for existing users. I deleted a user data folder and ever since I’m getting the “Forbidden” error. I removed the user from the ldap group, re-added and the problem still persists. Any way to fix this manually? Other users are ok. I now realize that deleting the users data folder makes you have a bad day.

Never mind I figured it out. The root folder for the ldap user was properly regenerated but it was missing the “files” folder. I recreated it as root but that didn’t work. You have to recreate the folders as “www-data” … now the permissions seem to be working properly. I just based the folder layout on a user that was working properly.


For those who ask themself where “to create the files”-directory (because I just had this question):

  1. Go to your nextcloud-data-directory (in case you don’t know: have a look into the config.php located under /var/www/html/config). In my case: /srv/nextcloud-data
  2. Inside /srv/nextcloud-data you see a folder for each of your user
  3. Go into the folder of the user that having this problem
  4. list all files in that folder - maybe you will see a folder “cache” but you will NOT see folder named “files”
  5. create the folder “files” as user www-data: sudo -u www-data mkdir files
  6. Try to upload a file - no it will work.