I've got a user named
foo. I'd like
foo to have all the same group memberships that I do. I thought I was close, with this:
sudo usermod -a -G $(id -Gn | tr " " ",") node4
id piped to
tr is working fine, producing output like
abc,def,ghi,jkl etc. The docs that I've found say that the way to add a user to multiple groups is
usermod -a -G ftp,admins,othergroup <username>.
When I run
id for the new user after running
sudo usermod, the user is only a member of one group, but the
id -Gn for me returns about 10 groups.
Is the sudo command what is goofing me up here?
edit: it seems like the issue here is that the groups are not actually in /etc/group, they are somehow populated from Active Directory.