Frage

How I can make sure that all new files created in a folder (by any user) inherit the folder ownership, for example:

/var/www/john -> owned by john:john

As the user root I create a new file into this folder, and the default ownership will be root:root, but I need that this new file inherit automatically (without chown or other) the john:john ownership.

Is it possible?

War es hilfreich?

Lösung

You probably want chmod +st /var/www/john

Read man chmod for all the details.

Andere Tipps

You can su to john first before creating the new file. Run the following and newfile will be owned by john:john.

su john
touch newfile
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top