Solved

FIle permissions

Posted on 2000-02-21
3
316 Views
Last Modified: 2013-12-06
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?
0
Comment
Question by:j2
  • 3
3 Comments
 
LVL 1

Expert Comment

by:rleyton
ID: 2541947
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.
0
 
LVL 1

Expert Comment

by:rleyton
ID: 2541949
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.
0
 
LVL 1

Accepted Solution

by:
rleyton earned 20 total points
ID: 2541950
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.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded‚Ķ
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

816 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now