I have a directory where I used to make the backup of my owncloud files from Ubuntu. It's owned by user 33 and group 33, which in Ubuntu are the www-data (Apache) user and group. Now I have changed the server's OS to OpenSUSE and the user and group for Apache are wwrun and www respectively with id 459. I'm pretty sure (although I haven't tried, but that's kind of irrelevant to the question) that that will give me problems when I mount that volume and try to backup stuff in it (it's not writable by everybody).
So I tried to change the ownership and/or the permissions of that directory, but even sudo
and sudo -u www-data
are impotent in this.
There are some similar questions around (like this, 15 years old), but I couldn't find any with an answer: is it at all possible to change owner or permission in such a case? If yes, how?
Further information
I tried the commands sudo chown -R user:user path/to/dir
, sudo -u wwwrun chown -R user:user path/to/dir
(because I was doing it from OpenSUSE) and sudo -u www-data chown -R user:user path/to/dir
(because I was doing it to Ubuntu)
and each time I got the error permission denied
.
I should however also say that I in the meantime "solved" the problem by mounting the disk with my uid and gid and now I have full access to it.
It would still be nice to know why those commands didn't work, since, like I said, by searching I have seen that other people have this problem.