up vote 4 down vote favorite
share [g+] share [fb]

On ubuntu server, I've noticed more than once now that after adding a user to a group that user doesn't have group permissions until I reboot the system. For example:

User 'hudson' needs permission to read directory 'root:shadow /etc/shadow' So I add hudson to the shadow group. hudson still cannot read. So, I 'sudo shutdown -h -r now' and when the system comes up again user hudson can read.

Is a reboot required or is there a better way to get permissions applied after adding the user to the group?

link|improve this question

45% accept rate
feedback

2 Answers

When adding a user to a new group, the user must log out and log back in for it to take affect. While a reboot will accomplish that, it should not be required.

link|improve this answer
How do I logout a user that was created by aptitude when installing a package? – Michael Prescott Jan 3 '10 at 1:45
What package creates the hudson user? – womble Jan 3 '10 at 2:55
As Justin answered, try stopping and starting the service. – Scott Pack Jan 3 '10 at 4:32
This is what I do. Simply log out and log back in. – Trent Scott Sep 17 '11 at 23:10
feedback

Adding a user to a group does not effect currently logged in users.

In the case of a daemon, you need to restart it for new groups to be applied.

Furthermore, restarting the daemon using an option in the daemon itself will not work as that will inherit the current environment.

The easiest way to get it to work is to fully stop the daemon and start it again, as in..

/etc/init.d/foo stop ; /etc/init.d/foo start
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.