Solved

FIle permissions

Posted on 2000-02-21
3
326 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
llcommand 6 109
Search for selected keywords and its values in multiple log files 11 70
Write an app 10 77
Need a version of telnet and/or ssh that supports tcp wrappers on AIX 5.1 16 109
My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Suggested Courses

742 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