Results 1 to 5 of 5

Thread: Default user and group owner for new contents

  1. #1
    Join Date
    May 2012
    Beans
    26

    Default user and group owner for new contents

    Hi,

    Is there any way that whenever any user will create any file or directory . The root will become its user and group owner by default. Basically I want this scenario in /var/www/html directory..

  2. #2
    Join Date
    May 2012
    Beans
    26

    Re: Default user and group owner for new contents

    Please give me suggestions........

  3. #3
    Join Date
    Feb 2011
    Location
    Somewhere...
    Beans
    1,559
    Distro
    Ubuntu 14.10 Utopic Unicorn

    Re: Default user and group owner for new contents

    You can setgid a folder so that all files and folders created in that folder will automatically take the group ownership of that folder's owner.
    Code:
    chmod g+s /folder/name
    You may need to sudo.

    I don't know how to make all files set to a specific owner though, because Linux ignores setuid on folders.

  4. #4
    Join Date
    May 2012
    Beans
    26

    Re: Default user and group owner for new contents

    Quote Originally Posted by zombifier25 View Post
    You can setgid a folder so that all files and folders created in that folder will automatically take the group ownership of that folder's owner.
    Code:
    chmod g+s /folder/name
    You may need to sudo.

    I don't know how to make all files set to a specific owner though, because Linux ignores setuid on folders.
    This solved my problem partially...but still how can I do this in a way that root will become its user owner ??

  5. #5
    Join Date
    Jun 2009
    Location
    Southern California
    Beans
    42
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Default user and group owner for new contents

    chown will change the owner of a file / dir

    file
    Code:
    chown <user> <file>
    directory
    Code:
    chown -R <user> <dir>
    Last edited by paul_be; June 8th, 2012 at 11:49 AM.
    linux-user#492021/ubuntu-user#27918
    Google is my homeboy

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •