create a directory belonging to the group - Redhat

This is a discussion on create a directory belonging to the group - Redhat ; Hi, Let's say I am user 'dave' belonging to groups 'dave' and 'server'. When I am in a certain directory, say /home/dave, I would like any 'mkdir dirname' command to result in 'dirname' being owned by 'dave' and belonging to ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: create a directory belonging to the group

  1. create a directory belonging to the group

    Hi,
    Let's say I am user 'dave' belonging to groups 'dave' and 'server'.
    When I am in a certain directory, say /home/dave, I would like any
    'mkdir dirname' command to result in 'dirname' being owned by 'dave'
    and belonging to group 'server'. But right now, the command

    mkdir dirname

    results in dirname being owned by user 'dave' and group 'dave'. What
    should I do so that creating directories results in those directories
    being owned by 'dave' but belonging to group 'server'?

    Thanks, - Dave

  2. Re: create a directory belonging to the group

    D. Alvarado wrote:
    > Let's say I am user 'dave' belonging to groups 'dave' and 'server'.
    > When I am in a certain directory, say /home/dave, I would like any
    > 'mkdir dirname' command to result in 'dirname' being owned by 'dave'
    > and belonging to group 'server'. But right now, the command
    >
    > mkdir dirname
    >
    > results in dirname being owned by user 'dave' and group 'dave'. What
    > should I do so that creating directories results in those directories
    > being owned by 'dave' but belonging to group 'server'?


    This is BSD semantics. Set the sguid bit on the directory (owned by
    group "server") if you want BSD semantics.

    Peter

  3. Re: create a directory belonging to the group

    D. Alvarado wrote:

    > Hi,
    > Let's say I am user 'dave' belonging to groups 'dave' and 'server'.
    > When I am in a certain directory, say /home/dave, I would like any
    > 'mkdir dirname' command to result in 'dirname' being owned by 'dave'
    > and belonging to group 'server'. But right now, the command
    >
    > mkdir dirname
    >
    > results in dirname being owned by user 'dave' and group 'dave'. What
    > should I do so that creating directories results in those directories
    > being owned by 'dave' but belonging to group 'server'?
    >
    > Thanks, - Dave


    chown -R dave:server mydir
    man chown


  4. Re: create a directory belonging to the group

    On 04/07/04 10:35, D. Alvarado wrote:
    > Hi,
    > Let's say I am user 'dave' belonging to groups 'dave' and 'server'.
    > When I am in a certain directory, say /home/dave, I would like any
    > 'mkdir dirname' command to result in 'dirname' being owned by 'dave'
    > and belonging to group 'server'. But right now, the command
    >
    > mkdir dirname
    >
    > results in dirname being owned by user 'dave' and group 'dave'. What
    > should I do so that creating directories results in those directories
    > being owned by 'dave' but belonging to group 'server'?
    >
    > Thanks, - Dave

    Set username 'dave' to be in the primary group 'server', ie in
    /etc/passwd set 'dave' to the the group number that correcponds to
    'server' in /etc/groups.

  5. Re: create a directory belonging to the group

    On Sat, 03 Jul 2004 17:35:28 -0700, D. Alvarado wrote:

    > Hi,
    > Let's say I am user 'dave' belonging to groups 'dave' and 'server'.
    > When I am in a certain directory, say /home/dave, I would like any
    > 'mkdir dirname' command to result in 'dirname' being owned by 'dave' and
    > belonging to group 'server'. But right now, the command
    >
    > mkdir dirname
    >
    > results in dirname being owned by user 'dave' and group 'dave'. What
    > should I do so that creating directories results in those directories
    > being owned by 'dave' but belonging to group 'server'?
    >
    > Thanks, - Dave


    chmod g+s

    will preserve the group ownership for all files and dirs created in that
    directory.

    --
    i.m.
    The USA Patriot Act is the most unpatriotic act in American history.


+ Reply to Thread