Monday 27 February 2012

usermod command

usermod command

the default path of the command is /usr/sbin

add one user to one group:
here use the option '-a'

from the manul
  -a, --append                  append the user to the supplemental GROUPS
                                mentioned by the -G option without removing
                                him/her from other groups

/usr/sbin/usermod -a -G group1 user_name

remove one user from one group, you have to move that user to another group:
/usr/sbin/usermod -G group2 user_name