Reload changes from /etc/group
If a user is logged in while changes in /etc/group than the changes are not applied to logged in user. How to reload the changes of /etc/group ??-
Responses
Hi,
The change should be visible immediately.
Did you try this:
a) Check current group membership as a user. Let's call username "myuser":
groups
b) Add this user to some groups in /etc/group. For example:
echo "ZZZ:x:23123:myuser" >> /etc/group
As a good practice, always ensure that /etc/gshadow is in sync after modifying /etc/group:
grpck
c) Recheck user again (without logging out):
groups
newgrp ZZZ
It should work.
What problem did you actually have?
Regards,
Dusan Baljevic (amateur radio VK2COT)
Hi,
Maybe this will help.
Are you running NSCD? It can cache such information as Unix group memberships. Any other name services you use (LDAP, and so on)?
It could also be SUDO caching. It caches the right to elevate, but not the password. It does so for only five minutes, by default.
/etc/sudoers uses per-user time stamp files for credential caching. Once a user has been authenticated, a record is written containing the uid that was used to authenticate, the terminal session ID, and a time stamp (using a monotonic clock if one is available). The user may then use sudo without a password for a short period of time (5 minutes unless overridden by the timeout option). By default, sudoers uses a separate record for each tty, which means that a user's login sessions are authenticated separately. The tty_tickets option can be disabled to force the use of a single time stamp for all of a user's sessions.
Check timestamp_timeout in /etc/sudoers.
Regards,
Dusan Baljevic (amateur radio VK2COT)
Hi,
Are you making changes in /etc/group or /etc/sudoers?
Changing /etc/sudoers file does not require a reboot or log off - changes are reflected immediately once the file is saved.
Visudo command is the recommended way to update sudoers content, since it protects against various failures.
Keeping changes in /etc/sudoers.d directory is a convenient way to add and remove permissions(application specific) instead of modifying the /etc/sudors file.
I could not replicate your problem on RHEL 7.4. It worked as expected. As soon as changes were done in /etc/sudoers, the permissions for user were updated, without user needed to log off and on.
Maybe you can provide more details of your scenario, including the O/S version?
Dusan Baljevic (amateur radio VK2COT)
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
