0

I have a home server for my website that is running on a mounted image. I mount the image as follows:

sudo mount -o loop,offset=19489299 raspbian-stretch-lite.img

I then mount my static website folder, www, inside the image as read only:

sudo mount --bind www/ /mnt/usr/share/nginx/www
sudo mount -o bind,rebind,ro /mnt/usr/share/nginx/www

Unfortunately my repo folders for my home git server are inside www (i.e., www/git/). This has been an issue because I cannot push any commits back to the server (since the repo folder is in read-only mode). Is there any way I can have my git folder (along with all the repos, of course) have write permissions but have all the rest of the folders/files inside www remain in read-only mode?

3
  • Use permissions in the normal way? Oct 8, 2020 at 20:21
  • Of course! This unfortunately means that I have to change to 777 so that "anybody" can write if I want to push remotely, right? Of course, I will have a ssh guard for pushing to git folder. Oct 8, 2020 at 21:30
  • No, you don't need 777 and should not attempt to use it, not even as a "test". You only need to allow the appropriate user(s) and/or group(s) to write to it. You didn't mention anything about users or groups though. Oct 8, 2020 at 22:40

0

You must log in to answer this question.

Browse other questions tagged .