From 3bfeacd2d77115066cec7233aff12571c4f9e959 Mon Sep 17 00:00:00 2001 From: Malin Freeborn Date: Wed, 5 Mar 2025 16:46:36 +0100 Subject: [PATCH] write managing groups --- system/managing_groups.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 system/managing_groups.md diff --git a/system/managing_groups.md b/system/managing_groups.md new file mode 100644 index 0000000..9ab53f9 --- /dev/null +++ b/system/managing_groups.md @@ -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). +