?
Solved

Ubuntu File Server, Permission Problems !

Posted on 2012-12-31
10
Medium Priority
?
407 Views
Last Modified: 2013-01-14
I have a remote file server running Ubuntu 10.04 but really and (I mean REALLY) struggling in getting the permissions set correctly..

I have users A,B,C,D.
User A is in groups admin and lxusers.
Users B,C,D are in the group lxusers.

I have a root share called 'Shared Folder' currently owner root & group is admin.  I want users to be able to create sub folders and files inside 'Shared Folder'. The user that creates folders and files will be the owner and those folders and files they create will inherit the parents group of admin. I only want the owner & members of the admin group to be able to delete any of the folders or files created, I am happy enough for any of the lxusers group to read anything thats created by any user.

This so far appears to be working to a point, but I do have one problem that is causing me real grief. If any user in the lxusers group creates a folder then files inside that folder, other users can delete the files but not the folder.. Just can't work out where I have gone wrong, advice to resolve would be appreciated..

Entry in smb.conf:-

[Shared Folder]
      browseable = yes
      writeable = yes
      invalid users = root
      path = /mnt/raid/Shared
      comment = Shared folder for All Users
      valid users = @admin,@lxusers
        create mode = 0774
        directory mode = 0774
        force group = admin

Kind Regards

John
DirPermissions.jpg
FilePermissions.jpg
0
Comment
Question by:mrmad1966
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
10 Comments
 
LVL 79

Accepted Solution

by:
arnold earned 2000 total points
ID: 38732685
What are the permissions on the folder?
You are forcing the files to be created with the group admin
You should use setfacl to include.
Not you would need to periodically rerun the setfacl directive to attach to changed files.

Group permissions of 7 (rwx) on file creation.  What is it you want? Do you want files created to have permissions of 644?
You can have directory 0770 while create mode of 750?

You should create yet another test share and try to vary your settings.
0
 
LVL 1

Author Comment

by:mrmad1966
ID: 38732734
Arnold, thank for the help.

The result of ls -l on the Shared folder is:-
drwxrwsr-T 45 root admin    4096 2012-12-31 13:48 Shared

HTH
0
 
LVL 79

Assisted Solution

by:arnold
arnold earned 2000 total points
ID: 38733123
Ok, getfacl Shared.

The group permission of 7 is what lets users delete files since any valid user runs with admin group membership.
0
How Blockchain Is Impacting Every Industry

Blockchain expert Alex Tapscott talks to Acronis VP Frank Jablonski about this revolutionary technology and how it's making inroads into other industries and facets of everyday life.

 
LVL 1

Author Comment

by:mrmad1966
ID: 38733294
Arnold, I have now installed acl. Here I post the output of getfacl Shared.
I have done as you suggested, setup a new share to play with. If I do not hear any more from you. Happy New Year .....
John
putty.log
0
 
LVL 1

Author Comment

by:mrmad1966
ID: 38733450
Arnold, The new share I created to play with is called NewSharedFolder.
UserA (thats me) is a member of the admin group I can confirm I can access the folder just fine. Users B,C,D  do not now have access to the folder..

I post another result of getfacl for the NewSharedFolder..

Thank you
putty.log
0
 
LVL 79

Assisted Solution

by:arnold
arnold earned 2000 total points
ID: 38733518
Have a happy new year as well.

At this point the getfacl repors the default (chmod 775 for root:admin)
Make sure when you define this new share, do not force admin as the default group for access while including your valid users @admin,@lxusers

The groupIDof(group) needs to be replaced with the numeric value of the group based on /etc/group

setfacl -R -m g:groupIDof(lxusers):rwx NewSharedFolder


The above will add read/write/execute rights
-R means apply the change recursively.

You would need to schedule the rerunning of this on a regular basis to update rights.
0
 
LVL 1

Author Comment

by:mrmad1966
ID: 38734140
Thank you Arnold. I have implemented this but one problem, the lxuser group can now indeed write folders and files to this NewSharedFolder but there seems to be no sticky set ie any member of the lxusers group can delete any other users folder/files. I wish only the owner AND a member of the admin group be allowed to delete folders and files.

Sorry for the headache !
0
 
LVL 79

Assisted Solution

by:arnold
arnold earned 2000 total points
ID: 38734389
If the lxuser group member needs only the ability to read, change the setfacl to read/execute only for this group
setfacl -R -m g:gid_lxusers:rx NewShareFolder

This way lxusers can read, but can not write nor delete.

Filesystem level restriction do not have the functionality you want, you need to look at document management system that will have the granular control I.e. will allow creation of files, but not deletion of other users files.
0
 
LVL 1

Author Comment

by:mrmad1966
ID: 38734817
Thanks... Need to go play now !
0
 
LVL 1

Author Closing Comment

by:mrmad1966
ID: 38777249
Thank you
0

Featured Post

Does Your Cloud Backup Use Blockchain Technology?

Blockchain technology has already revolutionized finance thanks to Bitcoin. Now it's disrupting other areas, including the realm of data protection. Learn how blockchain is now being used to authenticate backup files and keep them safe from hackers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month8 days, 12 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question