Will running usermod -g on RHEL7 make changes to the files in the users home directory?
Issue
-
RHEL7 version of usermod states (in its manpage):
-g, --gid GROUP The group name or number of the user's new initial login group. The group must exist. Any file from the user's home directory owned by the previous primary group of the user will be owned by this new group. The group ownership of files outside of the user's home directory must be fixed manually. -
Some use cases (ie. system users with '/' as home) require just changing the GID value in /etc/passwd, without actually touching any files in a home directory
Environment
- Red Hat Enterprise Linux (RHEL) 7
- shadow-utils-4.1.5.1-18.el7
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
