I've tried a variety of all of these, and I must warn others - be careful.
The following command will change a user's primary group. All set?
Code:
usermod -g group user
Unfortunately, this will also remove any other group associations the user had. One can quite easily remove all of one's superuser access with this command.
If you simply want to add a user to a supplementary group (retaining existing groups) run this.
Code:
usermod -a -G group user
The
-a is a recent addition, allowing for the retention of existing groups. You could go into /etc/passwd and change the group id associated with the user. This didn't work for me even after restarting the shell. The command that worked perfectly for me, was quite easily: