brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: chmod g+s on a shared folder fixes the group permissions of new files

Permissions
~/tips/tip-permissions-setgid-shared-directory

sudo chmod g+s /srv/shared

Makes new files in a directory inherit its group, so a team can share the folder.

In a shared folder every new file gets the primary group of whoever creates it, and the others cannot edit it.

sudo chmod g+s /srv/shared
ls -ld /srv/shared    # drwxrwsr-x

The s in the group column is the setgid bit. New files and folders in that directory get the directory’s group, and new subfolders inherit the bit. The files still need group write, so set umask 002 for the users, or use default ACLs. Existing files keep their old group until you run chgrp -R.

Further reading: chmod manual page

Going deeper: Guide: your Unraid cache is full and Docker stopped, how to find out why and fix it

More Permissions tips sudo su -s /bin/bash www-data sudo setfacl -R -d -m g:media:rwX /srv/media sudo cp -r /srv/site /srv/site.r ls -ln /srv/data newgrp media All Permissions tips (30) All topics

Link