allow all users to read/write any files/folders on 2nd drive regardless of who created it

10,514

What you're trying to create is a "world-readable" mount... Not very secure, but if that's what you want, you should not only allow the group, but also the user and others to read and write. Ideally, you would also like to do that for the already existing files recursively

So change:

sudo chmod g+w /files

to:

sudo chmod --recursive ugo+rw /files

However: absolutely, positively don't come back here to whine and complain after one of the users deletes the entire directory structure of another user to make space to store his/her/its collection of pr0n.

;-)

Share:
10,514

Related videos on Youtube

IMTheNachoMan
Author by

IMTheNachoMan

BY DAY: Alt-Rock Ninja Cowgirl at Veridian Dynamics. BY NIGHT: I write code and code rights for penalcoders.example.org, an awesome non-profit that will totally take your money at that link. My kids are cuter than yours. FOR FUN: C+ Jokes, Segway Roller Derby, NYT Sat. Crosswords (in Sharpie!), Ostrich Grooming. "If you see scary things, look for the helpers-you'll always see people helping."-Fred Rogers

Updated on September 18, 2022

Comments

  • IMTheNachoMan
    IMTheNachoMan over 1 year

    I am running 14.04 LTS. I've got a mount point called /files that is owned by root, the group is plugdev and I've given the group write permission. I used some of the information in https://help.ubuntu.com/community/InstallingANewHardDrive to set this up. Specifically the following commands:

    sudo chgrp plugdev /files
    sudo chmod g+w /files
    

    All the users on the machine are also part of plugdev.

    I've mounted a drive that has 1 ext4 partition to it.

    At this point both user1 and user2 can create files/folders in /files. But, if user1 creates a file or folder in /files then user2 cannot modify it or create files in it.

    I am wondering, how can I make it so all users can read/write (and, where applicable, execute) any/all files/folders created in /files regardless of who created it.

    If it matters, /files is also a Samba share that is mounted on a Windows 7 machine.

    • Wildcard
      Wildcard over 8 years
      I recommend downloading this free PDF: sourceforge.net/projects/linuxcommand/files/TLCL/13.07/… and reading Chapter 9: Permissions, particularly the section at the end on "Special Permissions". A combination of the setgid bit, the sticky bit, and a proper umask setting for your group members, should solve your situation.