Find the answer to your Linux question:
Results 1 to 3 of 3
Hello, I don't know if it's the right place for the following problem as it's not about building up a script. PROBLEM : adding a user to a secondary group ...
  1. #1
    Linux User
    Join Date
    Nov 2009
    Location
    France
    Posts
    292

    useradd : apply group membership changes

    Hello,

    I don't know if it's the right place for the following problem as it's not about building up a script.

    PROBLEM : adding a user to a secondary group is not reflected system wide immediately.
    It is only taken into account after rebooting the machine. (working in runlevel 5).

    user1 has primary group user1, home dir /home/user1 with permissions 0770.
    user2 has primary group user2, home dir /home/user2 with permissions 0700.

    Add user2 to group user1 :
    usermod -G user1 user2


    user2 shell:
    ls -l /home/user1 : fails

    touch /home/user1/test : fails.

    Both these commands are OK after a full reboot.

    How can we apply the group membership changes system-wide without rebooting ?

    Thank you.

  2. #2
    Linux User
    Join Date
    May 2008
    Location
    NYC, moved from KS & MO
    Posts
    251
    I don't think you need to do a full reboot for the new permissions to be effect. All you have to do is to log out as user2 and log back in again.

  3. #3
    Linux User
    Join Date
    Nov 2009
    Location
    France
    Posts
    292
    Yep, that's what I missed. After a new login, it works as expected.

    Thank you.

Posting Permissions

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