I was trying to add a user called bill to www group

useradd -G www bill

It gives me error

UX: useradd: ERROR: bill is already in use.  Choose another.

I checked if this user already in the group www by typing this command

group bill

it resulted


Which means he is not in www group but still i keep getting the error

Later I realized from this link that there are different commands to add existing user to existing group and adding a new user to new group. So I tries this command to add bill (an existing user) to www (an existing group)

usermod -a -G www bill

It gives me syntax error

UX: usermod: ERROR: Invalid syntax.
usage:  usermod -u uid [-o] | -g group | -G group[[,group]...] |
                -d dir [-m] | -s shell | -c comment |
                -l new_logname | -f inactive | -e expire |
                -A authorization [, authorization ...] | -K key=value ... |
                -P profile [, profile ...] | -R role [, role ...] login

Please help

1 Answer 1


You have two options: the usermod you wrote is correct, but the implementation you use does not handle -a. Just get rid of it and try again.

The second option is to use adduser from the adduser package. Then you will be able to write adduser username groupname. After logging out (and back in) you will have access to that group.

  • "-bash: adduser: command not found"
    – Windows
    Jan 4, 2013 at 11:35
  • Maybe you don't have it installed: apt-get install adduser
    – eppesuig
    Jan 4, 2013 at 11:39
  • moreover, the usermod you typed seems correct to me. It fails becuase the ubuntu usermod seems to ignore option -a. Could you try without using it?
    – eppesuig
    Jan 4, 2013 at 11:41
  • surprisingly working :) which didnt worked yesterday. can you update the answer with this because your answer leading to other issues?
    – Windows
    Jan 4, 2013 at 11:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .