Results 1 to 2 of 2

Thread: How to change default group assignment to new files

  1. #1

    Default How to change default group assignment to new files

    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

  2. #2

    Default Re: How to change default group assignment to new files

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    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/

    iQIcBAEBAgAGBQJK5uHUAAoJEF+XTK08PnB5r9wP/0bgjST+h5YH81mVub7T6GE3
    fS/yMQRKzwyAiXt+2VNkKQEGaQtiYeA1XoAhfX+rR0LiE/6aayn/6gldRznI4LHu
    rlV2qa6L3kZbwzsx1jImlXm0JmTe/W5nzxG4nu4iU66iVZmpR6/PvxladdoJc9UO
    xxXtZlFI6dTEvvKuPc1Lrnzru2Ze+X5e/cEkNORdsZXhnuJuD4jazHxMST2UMFoh
    TPGoWZGjNpwniX8i8yIPZKAcWjjC4dqYb1o31SDD1t9LrsHqExzK4A/AJk9qCThF
    M4g0/0+8FG1nyfC+pZR+2VB73UWn1uJvRife1gQNBmsoQwtmqnHotk1UKrRc357H
    I3nE73PYZb1BP62qY/SV1HZsTXjCUSWy8gfIZZPCpwrjPc/zvitJ0x2gTSBuNecn
    +JBbalnMNb2H0wSsqJG27222YO8v3NqSJHu7U81O6H7wdCu74o3xUltwG/jfdDzo
    Ew62VWwuKYjm49V74FKu0hzDKnHlbzhJJtcq3PlXJjaY7gRLS/mLYaMGfiAY0FiG
    oWLYKlrrDCTHNc+N7TpQR+qJ79+86YujVEXBwOHwFgjXORcIWp0Qq0KCrju6aB5r
    gv3GSpyZe20mMTW0XrWPSc8uBeAlxXNByM+JcfxIW6nFujwAPk6Ez5kV2E6XRjB9
    QTC7SSKdYfHfJsX06F1n
    =HmEO
    -----END PGP SIGNATURE-----

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •