Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade
Managing user groups on macOS can be efficiently handled using the dseditgroup
command-line tool. This utility allows you to create, modify, and delete groups, as well as manage group memberships, directly from the Terminal. This article will guide you through the practical usage of dseditgroup
with examples.
dseditgroup
is a command-line utility available on macOS that interfaces with the Directory Services to manage group information. It is particularly useful for system administrators who need to script or automate group management tasks.
To create a new group called "developers":
sudo dseditgroup -o create developers
To add a user named "john" to the "developers" group:
sudo dseditgroup -o edit -a john -t user developers
To remove a user named "john" from the "developers" group:
sudo dseditgroup -o edit -d john -t user developers
To delete the "developers" group:
sudo dseditgroup -o delete developers
To list all members of the "developers" group:
dseditgroup -o read developers
When using dseditgroup
, administrative privileges are required for creating, deleting, or modifying groups. Ensure you have the necessary permissions and use sudo
where appropriate.
If dseditgroup
does not meet your needs or you prefer a graphical interface, you can manage groups using the "Users & Groups" pane in System Preferences.