Help - Search - Members - Calendar
Full Version: /etc/profile <- Editing
Linuxhelp > Support > Technical Support
Does anyone know how to have all newly created files be owned by a certain group?
it depends who creates..the file..
If you add all the a particular group..then all the those..user will automatically belong to that group..
That's the problem. =/

I do NOT want the users to be of that group, but I want any files they create to be of that group.

All users belong to no group (or perhaps the "users" group), but I need their home directories to be viewable by apache (ie, group "nobody").

All their files/folders have a permission of 750
If you want group apache to have read permissions of /home/<user_name> that each user can have website on his own..then this is not the way to go..
Checkout file.../etc/httpd/httpd.conf
and you will find that each user can create a directory public_html
inside his home directory..and this directory can work as document root for apache..

If your problem was specific to apache..
What you have to do is allow..public_html as document root for each user.By default is disabled.
No, it's working fine, and httpd.conf is fine.

The problem is with permissions.

I do not want other members looking at other members files (thus the 750 permission), and yet I want the public to view it from the web (thus the "nobody" group).

Every member does have a ~/public_html directory by default (/etc/skel) happy.gif
the only way i see this working is for each user to be in their
own group by username
I guess that could work. O_o

Is there a way to add a user to multiple groups? (with usermod, maybe?)

You see, I have an automatic signup script (php), and I want everything to be automated. biggrin.gif
ya you can assign users to multiple groups
the command is
usermod -G groupname,groupname,etc.. username
Do I have to do that each time? Or can I just do "usermod -G newgroup user" and keep all the old groups that user was a part of?

Thanks for your help thus far. smile.gif
you should be able to just add each group seperatly but at times
i have had trouble with let say using the following

my username: chrisw is part of group chrisw also by default.

if i want to add my username to group nobody i would just use the following
usermod -G nobody chrisw
and it will add me to the nobody group

but this is where sometimes i have trouble...
if i want to later on add myself to the group operator, i would do the the same
as i did before...but then sometimes i would run into trouble being
that when i would add myself to the group operator, it would delete me from
the group nobody and add me to the group operator, which in a since would be
troublesome especially if i was part of alot of groups...

or sometimes it would work properly ..leaving me in the group nobody and also
adding me to the group operator...

you will just have to experiment with a user to find out exactly what happens...
i wish i could give you a definite answer but i have had both situations happen
to me in the what i usually do is just to be safe..add me back to
all existing groups plus the one i want to be added to...that way i dont
run into trouble and get bumped from a group.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2018 Invision Power Services, Inc.