Managing Groups - Paiet/Tech-Journal-for-Everything GitHub Wiki

  • Groups
    • Collections of user accounts
    • Allow for managing permissions for multiple people at once
  • Group Details
    • /etc/group
    • /etc/gshadow
  • /etc/gshadow
    • Groups can have a password
    • Users can provide the password to self-service join groups
    • sudo gpasswd Sales
  • Create groups:
    • groupadd <groupname>
    • groupdel <groupname>
    • getent group <group>
  • Adding users to a group
    • gpasswd
      • Add a user: gpasswd -a <user> <group>
      • Add a group admin: gpasswd -A <user> <group>
      • Remove a user: gpasswd -d <user> <group>
    • Listing group members
      • sudo groupmems -g sudo -l
  • Using groups
    • Users perform all actions under their primary group by default
    • groups <username> to see group membership
    • newgrp <groupname> temporarily changes that context
    • chgrp/chown can also be used
⚠️ **GitHub.com Fallback** ⚠️