Setting up permissions for common folder

syazdani

I am trying to setup a little home network using Linux as the File Server and have run into a bit of problems w.r.t. to folder permissions that I can't seem to solve. The setup:

  1. An Ubuntu 14.04 Linux File Server with Samba configured.
  2. A couple of Windows 7 client machines.

Every person in the house has been given a username/password to the Linux File Server and they can login to the server using SSH/Putty/whatever fine.

Samba on the Linux File Server has been configured to share out a couple directories in writable mode to Windows, and all the client machines can see this and read and write files. As an example, lets say that /media/data/photos is shared out as \fs01\photos. All Windows users can write to this photos directory and it works great. They can make sub-directories, put pictures, whatever, everything works.

The issue is that I want these shares (and all the directories beneath them) to be a free for all. Any user should be able to edit/rename/move/copy/delete any file from these folders. The problem arises when one user tries to move/organize/remove/rename files created by other users. So lets say that user A creates /media/data/photos/2014NewYearsEve and user B decides that it really should have been /media/data/photos/2014/NewYearsEve instead. In the way that I've set it up right now, I keep getting permission errors.

I understand that by default in Linux, the user that created the file is the owner of the file, so I get where the errors are coming from, and I know how to correct it manually (chown and chmod, and then any user can manipulate the files fine). But since the shares (e.g. /media/data/photos) are "common", I want the permissions to automatically reflect this when the file and directories are created. Coming from a Windows background (this is my first real Linux setup), I am quite confused on how to fix this.

Here is what I have tried (based on a whole bunch of articles on the internet, stackexchange and stuff):

I changed the group of the directory /media/data/photos to "nogroup" (sudo chown nobody:nogroup /media/data/photos) I set the setgid flag on the /media/data/photos directory (sudo chmod g+s /media/data/photos).

After this, files that are put in the shares seem to get the right group assignment (ls -l shows nogroup for the new files and subdirectories). But the execute right necessary (I think its necessary right?) to move files seem to be missing from the group (the permission in ls -l is -rwxrw-rw- for files and drwxr-sr-x+ for directories).

How do I get Linux to automatically add the x bit for the group for both files and directories? Or maybe more generally, how do I make the shares free-for-alls?

eyoung100

Create a new Group called Family. Give Family RWX Permissions, i.e. 777, for all folders attached to the samba share, and make family the owning group of the folders. Then add each family member to the group family.

  1. groupadd family
  2. chown -Rv root:family /linux/path/to/samba/share
  3. useradd -G family *username for mom*
  4. useradd -G family *username for dad*
  5. Repeat steps 3 and 4 until all family members are in family.
  6. chmod -Rv 0777 /linux/path/to/samba/share

New items will inherit the permissions from the owner, but if the owner is a member in family, it won't matter

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Setting up a subfolder's permissions differently to the parent folder for Samba

From Dev

Setting folder and files permissions

From Dev

Permissions setting for home folder

From Dev

Setting Up User Permissions

From Dev

Setting Up Push Notification Permissions

From Dev

Ubuntu 12.10 folder permissions (lost access to any folders after setting up sftp)

From Java

Setting up a common nuget packages folder for all solutions when some projects are included in multiple solutions

From Dev

Issue setting permissions on an nginx temp folder

From Dev

Setting folder permissions returns "Access Denied"

From Dev

Setting permissions on folders based on the folder name

From Dev

Setting up VSFTPD permissions with Apache server

From Dev

Setting up setuid VS giving execute permissions

From Dev

Setting permissions on files and folder - is folder perms inheritance always implicit?

From Dev

Setting up static folder path in Flask

From Java

Setting up tsconfig with spec/test folder

From Dev

setting up a synced folder that may not exist

From Dev

Setting separate file permissions for Owner, Group, and All on the same folder

From Dev

Setting up SSH/Git on Cygwin yields "Bad permissions on ~/.ssh/config"

From Dev

Do application installers set folder permissions? Or is it up to Windows?

From Dev

Windows 8 messed up my Windows 7 user folder permissions

From Dev

Using rsync to back up /home folder with same permissions, recursive

From Dev

Using rsync to back up /home folder with same permissions, recursive

From Dev

folder permissions

From Dev

setting up two git accounts on one machine based on parent folder

From Dev

Permissions folder/parent folder

From Dev

How do I set up a bash alias for a common working folder?

From Dev

Setting permissions so folder can't be deleted (but contents can be modified and deleted)

From Dev

How do you list the folder permissions of only certain directories that follow a common pattern in a particular directory?

From Dev

Trying to set up Amazon's S3 bucket: 403 Forbidden error & setting permissions

Related Related

  1. 1

    Setting up a subfolder's permissions differently to the parent folder for Samba

  2. 2

    Setting folder and files permissions

  3. 3

    Permissions setting for home folder

  4. 4

    Setting Up User Permissions

  5. 5

    Setting Up Push Notification Permissions

  6. 6

    Ubuntu 12.10 folder permissions (lost access to any folders after setting up sftp)

  7. 7

    Setting up a common nuget packages folder for all solutions when some projects are included in multiple solutions

  8. 8

    Issue setting permissions on an nginx temp folder

  9. 9

    Setting folder permissions returns "Access Denied"

  10. 10

    Setting permissions on folders based on the folder name

  11. 11

    Setting up VSFTPD permissions with Apache server

  12. 12

    Setting up setuid VS giving execute permissions

  13. 13

    Setting permissions on files and folder - is folder perms inheritance always implicit?

  14. 14

    Setting up static folder path in Flask

  15. 15

    Setting up tsconfig with spec/test folder

  16. 16

    setting up a synced folder that may not exist

  17. 17

    Setting separate file permissions for Owner, Group, and All on the same folder

  18. 18

    Setting up SSH/Git on Cygwin yields "Bad permissions on ~/.ssh/config"

  19. 19

    Do application installers set folder permissions? Or is it up to Windows?

  20. 20

    Windows 8 messed up my Windows 7 user folder permissions

  21. 21

    Using rsync to back up /home folder with same permissions, recursive

  22. 22

    Using rsync to back up /home folder with same permissions, recursive

  23. 23

    folder permissions

  24. 24

    setting up two git accounts on one machine based on parent folder

  25. 25

    Permissions folder/parent folder

  26. 26

    How do I set up a bash alias for a common working folder?

  27. 27

    Setting permissions so folder can't be deleted (but contents can be modified and deleted)

  28. 28

    How do you list the folder permissions of only certain directories that follow a common pattern in a particular directory?

  29. 29

    Trying to set up Amazon's S3 bucket: 403 Forbidden error & setting permissions

HotTag

Archive