when I create a file in linux it is automatically assigned a group. In OS11.0 it is “users”. How do I change this default assignment?
That is, I want all files created by my user to be assigned not “users” but some other group. How to do that?
By default a file/directory is group-owned by the primary group of the
user that created it. For example, your user’s primary group is
apparently ‘users’. There are a couple ways to change this. First, you
can change your primary group to something else. Second, you can create
the files/directories in a directory that has the SGID bit set which means
all files/directories within there will be group-owned by the same group
as the group-owner of the parent directory. This is useful if you have
another group that everybody is a member of and you want to share files by
making all files in that directory modifiable by those group members. For
example:
groupadd somenewgroup
mkdir /tmp/testsgid
chgrp somenewgroup /tmp/testsgid
chmod 2770 /tmp/testsgid
groupmod -A youruser somenewgroup
groupmod -A someotheruser somenewgroup
<login/login with your user to apply changes>
Now all files created in /tmp/testsgid will be group-owned by
‘somenewgroup’ which means anybody in that group (per the directory’s
permissions) can do anything they want with those files regardless of who
else created/modified the files.
What would be really helpful if you told us WHY you wanted to do what you
were asking.
Good luck.
genesup wrote:
> Hello,
>
> when I create a file in linux it is automatically assigned a group. In
> OS11.0 it is “users”. How do I change this default assignment?
> That is, I want all files created by my user to be assigned not “users”
> but some other group. How to do that?
>
> Thanks for your time.
> SDA
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/