write managing groups

This commit is contained in:
Malin Freeborn 2025-03-05 16:46:36 +01:00
parent ed4b54cf7e
commit 3bfeacd2d7
Signed by: andonome
GPG Key ID: 52295D2377F4D70F

32
system/managing_groups.md Normal file
View File

@ -0,0 +1,32 @@
---
title: "Managing Groups"
tags: [ "system" ]
---
Check which groups you are in, and which are available:
```sh
cat /etc/group
groups
cat /etc/group | grep $USER
```
Remove yourself from all groups, and add yourself back to only `wheel`, `audio`, and your own group:
```sh
sudo usermod --groups wheel,audio,$USER
```
Add yourself to the `wheel` group:
```sh
su root -c "usermod --append --groups wheel $USER"
```
Add yourself to the `network` group:
```sh
sudo usermod -aG network $USER
```
The changes will not take effect until you log in again, so reboot or log into `localhost` with [ssh](../networking/ssh.md).