You’ll need root access to configure groups with the pw command.
To add an existing user account to the wheel group, you’d use the command with the following syntax:
For example, to add the user younis, we’d issue the following command:
Let’s add a new user to the wheel group now. The command simultaneously creates a new user and add it to the group; the command syntax should be:
As an illustration, we’ll add a new user sai to the wheel group.
The user sai will be created a new and also be added to the wheel group.
Check group memberships on FreeBSD with the commands below:
To check the group memberships of particular users, use the id command as follows:
Wrapping things up
This tutorial showed you how to add both new users and existing user accounts to the wheel group. We used different variations of the pw command for our demonstration.