Hi,
I've added my user to multiple groups in /etc/group, but running "id" only shows the primary group.
$ id uid=1003(alex) gid=1003(alex) groups=1003(alex)
This user belongs to a number of other groups. $ grep ^alex /etc/group alex:x:1003:group1,group2
I remember many years ago having to modify /etc/nsswitch.conf to allow the user to join multiple groups, but I don't recall what those changes are, or if that's even the proper way anymore. Ideas?
Of course I've logged out and logged in again
On 6/28/22 17:14, Alex wrote:
I've added my user to multiple groups in /etc/group, but running "id" only shows the primary group.
$ id uid=1003(alex) gid=1003(alex) groups=1003(alex)
This user belongs to a number of other groups. $ grep ^alex /etc/group alex:x:1003:group1,group2
You're doing that wrong. You just added non-existent users to your "alex" group. You should probably use the "usermod" command instead of directly editing the file.
usermod -a -G group1 alex
Hi,
This user belongs to a number of other groups.
$ grep ^alex /etc/group alex:x:1003:group1,group2
You're doing that wrong. You just added non-existent users to your "alex" group. You should probably use the "usermod" command instead of directly editing the file.
usermod -a -G group1 alex
Yes, thank you - got it backwards in my old age.