Adding a user to a group

Hello guys!!

If a user is already created on a server, how do you add them to another group?

The useradd command? If so then would that duplicate the user account on the server?

Thanks
Bigben

It depends on your OS.

Perhaps usermod?

My OS is HPUX...

Thanks in advance for the help!

It's still usermod (probably! I haven't used HPUX in a long time, but there is a man page for usermod that indicates we're onto something here).

Check the man page.

On Red Hat, I just ran:

# usermod -G gdm root

# id root
uid=0(root) gid=0(root) groups=0(root),42(gdm)  ...

The usage might not be the same on HP, which is why you should read the manual page.

On debian :

adduser user group

add user to group if user already exists