buffed317's instructions are for changing what (user &) group owns a file. I don't think that's what you were after, though.
In the following examples I'll call the groups "oldgroup" and "newgroup", instead of "pikachu" and "monitor". (This is just to avoid the confusion of talking about a user and a group both named pikachu.) I'll still call the user "pikachu".
To make the user pikachu a member of group newgroup, you could try the following (but read below first):
Code:
usermod -g newgroup pikachu
A small complication is that pikachu could be a member of multiple groups. One way to check is to use this command:
I believe the "usermod" command I gave above (with the lower case -g) should replace the first group listed in the output of the "groups" command.
For more information you can look in the usermod man page:
Another way you can do it is to edit the /etc/passwd and /etc/group files directly (which is what usermod does under the covers.) Just note that a user's main/first group is kept (as a numerical ID) with the user's entry in /etc/passwd. Secondary groups, on the other hand, are indicated by adding the user to each secondary group's entry in /etc/group. (If this last paragraph makes no sense, don't worry. It's just informational, and probably not well written. :-)