• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 626
  • Last Modified:

Linux Question

I am trying to do permissions to a folder for multiple groups, each will have different permissions to the directory. Can you let me know how to do this without using ACL's?

Group 1 RW
Group 2 R
Group 3 RWX

Thanks
Josh
0
Jack_son_
Asked:
Jack_son_
  • 2
3 Solutions
 
badwolfffCommented:
On ubuntu if you want to restrict access to only two groups say Group01 full access and Group02 having only read only access, In this case you can use file access control list (ACL). (In your case I think itis the best solution)

setfacl -R -m g:Group01:rwx Folder01
setfacl -R -m g:Group02:r-- Folder01
You can verify changes via getfacl Folder01.And you can remove all permissions for others like this chmod -R o-rwx Folder01

So by this your folder is only accessible via Group01 ( full access ) and Group02 (read only access) and no doubt owner of that folder can also access that folder.
0
 
Jack_son_Author Commented:
That is good, although can you do this without using an acl?
0
 
badwolfffCommented:
As far as I know it that is that only way. You can make a directory belong to multiple groups by mounting the relevant partition with POSIX Access Control Lists (ACL) activated.

The programs to work with ACLs, once the file system is mounted to support them, are getfacl and setfacl:
http://manpages.ubuntu.com/manpages/saucy/man1/getfacl.1.html
and
http://manpages.ubuntu.com/manpages/precise/man1/setfacl.1.html

You might find this very useful:
https://help.ubuntu.com/community/FilePermissionsACLs
and this:
http://www.tecmint.com/secure-files-using-acls-in-linux/
0
 
TobiasHolmCommented:
>how to do this without using ACL's?

Not possible in standard Linux/ext-fs (afaik). You'll need ACL or use another system (like Microsoft AD/Samba).
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now