Primary vs supplementary groups
Every user has one primary group recorded in /etc/passwd, and may belong to multiple supplementary groups recorded in /etc/group.
Solaris · Group Management
Solaris · Lesson 5
Manage local groups and permissions in Solaris 11. Add and modify groups with commands. User membership control. Enterprise security best practices.
Groups allow you to manage permissions for sets of users instead of individuals. Instead of giving access user-by-user, you assign permissions to a group and add users to it. This is critical for maintainable access control on any multi-user Solaris system.
In this lesson you will learn how to create groups, add users to them, and use groups to control access to shared directories.
Every user has one primary group recorded in /etc/passwd, and may belong to multiple supplementary groups recorded in /etc/group.
Directory and file permissions are often granted to a group, and all members of that group inherit the same level of access.
It is common to create one group per project or application team so that ownership and access are easy to reason about.
Use the following commands in your Solaris lab VM to understand how groups are stored and how they affect access to shared directories.
Start by looking at /etc/group to understand which groups already exist on the system.
Use groupadd to create a new application or project group with a specific GID (optional).
Use usermod -G (or -a -G depending on OS) to set the list of supplementary groups. On Solaris, -G replaces the list.
Use su - to switch to the user and check groups from their perspective.
Create a shared directory owned by the group and give group write access so all team members can collaborate.
You can change group attributes with groupmod and remove unused groups with groupdel.
projectx and add two users to it (for example, devuser and opsuser)./projects/projectx, set its group ownership to projectx and apply chmod 2775.In upcoming lessons, we will build on users and groups when we talk about permissions, services and real-world troubleshooting.