Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello,
I created a group with the name "group1" and I want to join this group to another existed group. How can I do it?
For example, "apache" group has permission on a directory and I want to add a new group to that directory or add new group to "apache" group.
How a directory could have more than one group?
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,801
Rep:
Quote:
Originally Posted by n00b_noob
Hello,
I created a group with the name "group1" and I want to join this group to another existed group. How can I do it?
For example, "apache" group has permission on a directory and I want to add a new group to that directory or add new group to "apache" group.
How a directory could have more than one group?
You could simply add members to the "apache" group.
I know of no way to have more than one group access defined for an object... other than creating an access control list (ACL) for the object (file, directory, etc.). In the ACL, you would specify the groups that you need/want to have access to it---and the access they're allowed to have. See the manpages for "getfacl(1)", "setfacl(1)", and, especially, "acl(5)" for the details.
Unix does not support the concept of nested groups, so that option's out.
Standard Unix file/directory permissions only allow for three sets of permissions: One set for the owning user, one set for the owning group, and one set for everybody else. You may however use Access Control Lists, provided both your kernel and the filesystem in question supports it (they almost certainly do, unless you run a truly ancient/weird kernel and/or FS). You may have to add the "acl" option to /etc/fstab in order to activate this feature, though.
As rnturn said, the man pages for the userspace utilities (man setfacl and man getfacl) should contain enough information to get you started.
As mentioned, ACLs can add multiple groups to a directory. The manual pages mentioned are an authoritative reference. There are not many guides or tutorials out there, however.
It usually a rare occurrence to need an ACL though. So can you clarify what you are trying to set up and we may be able to find a less complicated way to solve the problem.
Yes. There's no reason to mess with groups in your DocumentRoot space.
Make directory for your user...owned by them and using their group.
Insure that that directory is chmod 755
Insure that any files in that directory are 644
...that's managed by the user's umask setting. Typically, you shouldn't need to change that, but just touch a file in that directory to confirm that files created by that user are 644
Here's a snippet of our DocumentRoot
user1, user2 and user4 each own their own space and can upload files to them as they wish.
user3 is me. I maintain site3 and site4.
Because the directories and files are world/other readable, the web server can serve them.
This is all guess at the problem you're trying to solve of course, but we see these questions about web spaces a lot, and I've been operating a webserver just this way for two decades with no problems.
As mentioned, ACLs can add multiple groups to a directory. The manual pages mentioned are an authoritative reference. There are not many guides or tutorials out there, however.
It usually a rare occurrence to need an ACL though. So can you clarify what you are trying to set up and we may be able to find a less complicated way to solve the problem.
I want a new group have the same permission of "apache" group on a same directory.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.