August 15, 2025

Mentoring session: fixing cgit permission error

This is the second with a summary about K. helping me learn more about system admin, IT, the cli, etc.

This time we worked on fixing an permission error on a cgit instance I tried to set a few months ago. You can see the whole set up process I followed there: https://yctct.com/cgit-instance-set-up).

I had a permission error: the user managing cgit could access the repositories on the same VPS.

To do we looked at the error logs of nginx:

# tail /var/log/nginx/error.log

Then, check the cgit config:

# grep cgit /etc/nginx/sites-available/*

Then, try to see what user was running cgit:

# ps auwx | grep cgit

We assumed that the user www-data run the cgit process — I don’t remember tbh.

So we changed group owner of the directory where the repositories live, so that the user running the cgit process can access the repositories:

# chgrp -R www-data /path/to/repositories/

Then, as far as I can remember, we did this a few days ago, we also gave execution access to the group:

# chmod g+x /path/to/repositories/

We also had to do this for the directories of single repositories. I don’t know if we could have done that recursively, probably.

Since then, I added a repository to the directory repositories, on the VPS, and it looks like I have to modify permissions for the repository to show up on git.yctct.com. I need to look for a way to simply this, so when I add a repository to cgit, it shows up.


personal computing command-line interface (cli) gnu linux trisquel shell literacy wiki mentoring cgit

No affiliate links, no analytics, no tracking, no cookies. This work © 2016-2025 by yctct is licensed under CC BY-SA 4.0 .   about me   contact me   all entries & tags   FAQ   GPG public key

GPG fingerprint: 2E0F FB60 7FEF 11D0 FB45 4DDC E979 E52A 7036 7A88