I have a lot of groups (20) associated with my Linux account. I've learned that to use the groups near the end of the list I need to use the 'newgrp' command so that my particular group shows up at the beginning of my list. On our system, anyone with more than 16 groups will get permission denied errors when trying to access files/folders belonging to a group listed after the first 16 assigned to the user.
For example, when I run
groups I get the following output:
g1 g2 g3 g4 g5 g6 g7 g8 g9 g10 g11 g12 g13 g14 g15 g16 g17
But when I try and access files belonging to
g17 I get a permission denied error. I can get around this by running
newgrp g17 after which the
groups command returns:
g17 g1 g2 g3 g4 g5 g6 g7 g8 g9 g10 g11 g12 g13 g14 g15 g16
Is there a way to set the default order for my groups so that I can set my commonly used groups to the top of the list so that I don't need to use
newgrp so often? I have a few groups that I use most frequently and I'd like to have it such that those show up at the beginning of the list every time I log into a server.