Will running usermod -g on RHEL7 make changes to the files in the users home directory?

Solution Unverified - Updated -

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, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content