Results 1 to 3 of 3

Thread: Public shared folder permission issue

  1. #1
    Join Date
    May 2009
    Location
    Ontario, Canada
    Beans
    67
    Distro
    Ubuntu 14.04 Trusty Tahr

    Thumbs down Public shared folder permission issue (Solved)

    Hi, Guy,

    How to set a folder any user can write to and the same file can be overwrite by others.

    I have to set up a tftp server, which sets up /tftpboot/, I've set the folder to have mod 777 and owner nobody.

    Anyone can write to the folder, but my problem is if if someone write a file in this folder, as /tftpboot/user1.file.
    This file has owner:group user1:user1, another user is not able to overwrite the the same file without sudo.

    Is there kind of mother setting of a folder, which automatically changes ownership of it's contents? Or in other word, let folder contents to inherit folder properties. AUTOMATICALLY!, not every time manually # chmod -R 777 /tftpboot/ and # chown -R nobody /tftpboot/

    Side experimental note: Looks like if I do once # chmod -R 777 /tftpboot/ and # chown -R nobody /tftpboot/
    As long as I don't switch user and write file to the /tftpboot/ folder, or log out, I can overwrite the file and file's ownership won't change to user:user


    Thanks,
    Last edited by legendbb; June 7th, 2011 at 04:05 PM. Reason: Got solution

  2. #2
    Join Date
    Jan 2008
    Location
    New Jersey
    Beans
    44
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Public shared folder permission issue

    Hello,

    I'm not too sure if what you want to do is possible. But another solution is this:

    Set the group of the folder tftpboot to be a newly created group. Then, turn on the sgid bit for that directory:

    Code:
    chmod g+s /tftpboot
    This will make it so any file created under that directory will have the same group as the directory itself. So when any user creates file, it will be in the same group. So all you need to do after that, is add all of the users to that one group. Everyone should then be able to write / read the files in that directory.

  3. #3
    Join Date
    May 2009
    Location
    Ontario, Canada
    Beans
    67
    Distro
    Ubuntu 14.04 Trusty Tahr

    Thumbs down Re: Public shared folder permission issue

    Great thank to your knowledge,

    Just add a side notes, I feel might be useful for google search,

    after setting sgid, mv a file will still keep it's GID, cp a file in the sgid directory works.

Tags for this Thread

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
  •