Solved

FIle permissions

Posted on 2000-02-21
3
301 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
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.
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

760 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

20 Experts available now in Live!

Get 1:1 Help Now