propagating directory perms to new files in that directory

propagating directory perms to new files in that directory

Post by Glen » Mon, 25 Mar 2002 13:50:02



I've got a directory (/var/shared) that is owned by root:shared, and is
in mode 770.  Two users (glen and ewan) are members of the 'shared'
group.  If I do `touch /var/shared/foo` as 'glen', then the file 'foo' is
owned by glen:glen.  Is there any way to configure the directory so that
the new file is automagically owned by root:shared, or at least
glen:shared?

--
Cheers,
Glen

 
 
 

propagating directory perms to new files in that directory

Post by Michael Heimin » Mon, 25 Mar 2002 23:58:55



Quote:> I've got a directory (/var/shared) that is owned by root:shared,
> and is
> in mode 770.  Two users (glen and ewan) are members of the
> 'shared'
> group.  If I do `touch /var/shared/foo` as 'glen', then the file
> 'foo' is
> owned by glen:glen.  Is there any way to configure the directory
> so that the new file is automagically owned by root:shared, or at
> least glen:shared?

You don't want root:shared, glen:shared should be no problem.
Try:
'man newgrp'

Michael Heiming
--
Remove the +SIGNS case mail bounces.

 
 
 

propagating directory perms to new files in that directory

Post by Richard Howlet » Tue, 26 Mar 2002 04:16:09



> I've got a directory (/var/shared) that is owned by root:shared, and is
> in mode 770.  Two users (glen and ewan) are members of the 'shared'
> group.  If I do `touch /var/shared/foo` as 'glen', then the file 'foo' is
> owned by glen:glen.  Is there any way to configure the directory so that
> the new file is automagically owned by root:shared, or at least
> glen:shared?

man chmod  and look for the text about the "group set bit".
Essentially you need to do something like: chmod g+ws /var/shared

--
Richard Howlett


 
 
 

propagating directory perms to new files in that directory

Post by those who know me have no need of my nam » Tue, 26 Mar 2002 09:47:08



Quote:>I've got a directory (/var/shared) that is owned by root:shared, and is
>in mode 770.  Two users (glen and ewan) are members of the 'shared'
>group.  If I do `touch /var/shared/foo` as 'glen', then the file 'foo' is
>owned by glen:glen.  Is there any way to configure the directory so that
>the new file is automagically owned by root:shared, or at least
>glen:shared?

other responses have described forcing the group.  in order to force the
owner your system has to support acl's that can do that, and since you
didn't mention what system you are using i won't try to guess the answer.
but you can look at your system's documentation to find it.

--
bringing you boring signatures for 17 years

 
 
 

propagating directory perms to new files in that directory

Post by Glen » Tue, 26 Mar 2002 18:11:38



> man chmod  and look for the text about the "group set bit". Essentially
> you need to do something like: chmod g+ws /var/shared

Thanks mate ... that did it :)

--
Cheers,
Glen

 
 
 

propagating directory perms to new files in that directory

Post by Frank Winkle » Tue, 26 Mar 2002 20:40:55



> I've got a directory (/var/shared) that is owned by root:shared, and is
> in mode 770.  Two users (glen and ewan) are members of the 'shared'
> group.  If I do `touch /var/shared/foo` as 'glen', then the file 'foo' is
> owned by glen:glen.  Is there any way to configure the directory so that
> the new file is automagically owned by root:shared, or at least
> glen:shared?

If you set the 's' bit for the directory, new files will get the correct
GID: 'chmod g+s /var/shared'

Regards

--
---------------------------------------------------------------------------

Sun Microsystems - Remote Admin Center
Sonnenallee 1                                       Voice +49 89 46008.2755
85551 Heimstetten - Germany                           Fax +49 89 46008.2740

 
 
 

1. umask on directories and perms on new created home dirs

Hi,

I have two short quetions.

1. Is there something  similar to  umask but on directories,  so a user
that changes into a particular directory gets automatically a new umask
(without typing umask 007).

eg.
/home        umask 022
/projekts   umask 007
...

I know that I can add the sgid bit to a directory to force all new
created files/dirs gets owned by a special group. But what about the
umask....

2. I use useradd to create new accounts. With the -m option I
automatically create the new directory. The new homedirectory then has
the permissions 0755, is there a configfile where I can set these
initial perms to 0700 (just for the useradd command).

Thanks, Ralf

--
Ralf Gross

* Linux is like a Wigwam. No Windows, no Gates, and an Apache inside *

2. How to get my local ethernet ip on which i receive a socket data??

3. Script that recurses through all directories tries to check file/directory named "*"

4. RH 6.0 Installation -- Tricks needed...

5. Login Error -- getcwd: cannot access parent directories: No such file or directory

6. elvis editor

7. SEGV in NFS in deep directory (was: bash: looping over all files in directory)

8. ufsdump / crontab

9. Directory/files get the same ACLs than the parent directory ?

10. copying a directory structure with a particular file in directories below

11. find files in one directory to use to search through another directory

12. help.move.file.from.sub directory.to.parent.directory

13. Q: copy directory (containing links) as directory (as files)