Articles

Fixer le groupe des nouveaux fichiers créés dans un répertoire

ExoConsult

Statut de vérification technique indisponible

Dans cet article

If you want all new files in a particular directory to be owned by a particular group, just apply the setgid bit on it :

chgrp www-data /some/dir
chmod g+s /some/dir

If you have an existing tree of directories that you want to apply this behaviour to, you can do so with find :

find /some/dir -type d -exec chgrp www-data {} +
find /some/dir -type d -exec chmod g+s {} +

(if the directories are already owned by the relevant group, then you can omit the first command in both of these examples).

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Vous avez une mission ou un projet en tête ?

Parlez-moi de ce dont votre équipe a besoin ou du problème que vous cherchez à résoudre.