Server Default Permission

FinLy

Verified User
Joined
Mar 23, 2007
Messages
12
Good evening,

I am asking for some help.

This is what I have:

/var/www/* owned by www-data, group set to tim and permissions set to 775
or:
drwxrwxr-x www-data tim www


Now when I create a directory under /var/www/ say images, it gets the following permissions:

/var/www/images/* owned by tim, group set to tim and permissions set to 755
or:
drwxr-xr-x tim tim images

I then create a file in the /var/www directory, say index.php, it gets the following permissions:

/var/www/index.php owned by tim, group set to tim, permissions set to 644
or:
-rw-r--r-- tim tim index.php

How do I FORCE the directory of /var/www so that ANYTHING (file or folder) created underneath it by anyone of any group or any username is set to:

owned by www-data, group set to tim, permissions set to 775
drwxrwxr-x

Setting the umask won't cut it because that does every file and only sets permissions not users and groups.....

Surely there has to be someway to specify the default user and group for files under a folder as well as their permissions...?
 
There are always ways, but I don't see why umask won't help for the permissions.

To set the username or group name there's a sticky bit you can set in the directory, and the directory has to have the ownership you want extended to the files.

If that won't do what you want, then you can run (as root) a cron job every x minutes to do what you want with all the granularity you need.

Does this have anything to do with using a DirectAdmin control panel?

Jeff
 
Back
Top