What are primary and secondary groups?

In Linux, user groups are categorized into primary and secondary groups:

  1. Primary Group:

    • Each user has one primary group, which is set when the user account is created.
    • The primary group is typically used for file ownership. Files created by the user will belong to this group by default.
    • For example, if the primary group of a user "jack" is "jack," any files created by "jack" will be owned by the "jack" group.
  2. Secondary Groups:

    • A user can belong to multiple secondary groups in addition to their primary group.
    • Secondary groups allow users to access resources and permissions associated with those groups.
    • For instance, if "jack" is also a member of the "sudo" group, he can execute commands with elevated privileges.

This grouping system helps manage permissions and access control efficiently. If you have more questions or need clarification, feel free to ask!

0 Comments

no data
Be the first to share your comment!