How to Correct the UID or GID

The Unix and Linux operating systems use numbers to represent users and groups. Each user is assigned a user ID, or UID, number and a primary group ID, or GID, when the account is created. Each UID is unique, but many users can have the same GID. Use the "usermod" command to change or correct UIDs and GIDs for existing users. Only the root user can correct a user's UID or GID.

Instructions

    • 1

      Open a terminal window or log in to the computer through an SSH session.

    • 2

      Type the following command to switch to the root user:

      su -

    • 3

      Type the root password when prompted.

    • 4

      Type the following command to change the UID:

      usermod -u 999 username

      Replace "999" with the correct UID. Replace "username" with the name of the user whose UID you want to correct.

    • 5

      Type the following command to change the GID:

      usermod -g 1000 username

      Replace "1000" with the correct GID. Replace "username" with the name of the user whose GID you want to correct.

    • 6

      Type the following command to close the root session:

      exit

Related Searches:

References

Comments

Related Ads

Featured