Register
It is currently Tue Sep 02, 2014 8:05 pm

usermod : apply system wide


All times are UTC - 6 hours


Post new topic Reply to topic  [ 3 posts ] 
Author Message
 PostPosted: Sun Nov 29, 2009 4:39 am   

Joined: Sun Nov 29, 2009 4:28 am
Posts: 2
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 :
Code:
usermod -G user1 user2


user2 shell:
Code:
ls -l /home/user1
: fails
Code:
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.


Top
 Profile  
 PostPosted: Mon Nov 30, 2009 2:02 am   
User avatar

Joined: Sat Jun 13, 2009 8:53 pm
Posts: 73
Location: Texas!
What distro are you running?

Based on your example, it looks like user2 is not logged in during the execution of usermod. Is this correct? If user2 is logged in, usermod may fail silently!

- thobbs


Top
 Profile  
 PostPosted: Mon Nov 30, 2009 4:27 am   

Joined: Sun Nov 29, 2009 4:28 am
Posts: 2
Actually, the solution is for user2 to logout and login again. Then it works as expected. usermod does not fail i user2 is logged, but the changes are not propagated to user2's session. It was suggested on another discussion forum.

Thank you.


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Google [Bot] and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP