Link to home
Start Free TrialLog in
Avatar of j2
j2Flag for Sweden

asked on

FIle permissions

How on earth fo i set the permissions in HP-UX to make all files created in a dire 'inherit' the permissions of the dir? (including uid / gid?)

The dir is chown caduser:cadgrp and chown 775, but when a user create a file in the dir it gets his/her uid/gid. Any hints?
Avatar of rleyton
rleyton

You don't really want to set a directory to create files in another uid (think about it - unless you ARE the user, you don't want that - you always want to know who created the file), and in any form of Unix I've ever used, you can't.

But you CAN set the files to have the directory  GID set. Set the 'set gid' bit. The easiest way is:

chmod g+s .

Or chmod 4774 .

If you want others to write to the file, just make sure that everybody who writes to the directory has a umask of at least '002'.

Be careful with the meaning of 'set gid' and 'set uid' when it pertains to directories - they have VERY different meanings when applied to files.

Regards,

Richard.
You don't really want to set a directory to create files in another uid (think about it - unless you ARE the user, you don't want that - you always want to know who created the file), and in any form of Unix I've ever used, you can't.

But you CAN set the files to have the directory  GID set. Set the 'set gid' bit. The easiest way is:

chmod g+s .

Or chmod 4774 .

If you want others to write to the file, just make sure that everybody who writes to the directory has a umask of at least '002'.

Be careful with the meaning of 'set gid' and 'set uid' when it pertains to directories - they have VERY different meanings when applied to files.

Regards,

Richard.
ASKER CERTIFIED SOLUTION
Avatar of rleyton
rleyton

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial