`adduser [options] user group` fails ubuntu 11.04

6,577

Solution 1

Rob, re-read the error message from adduser command: The user rick does not exist.. Later you write about group staff, which does exist. But adduser failed because user rick does not exist yet.

Solution 2

If you are trying to add an user and add this user to a group, you should:

adduser newuser
usermod -aG thegroup newuser

If thegroup isn't yet created, you should create it before the usermod:

groupadd thegroup
Share:
6,577

Related videos on Youtube

sillyfem
Author by

sillyfem

SOreadytohelp

Updated on September 18, 2022

Comments

  • sillyfem
    sillyfem over 1 year

    I'm want to use adduser However it doesn't seem to work if I provide the second argument for the user's group

    root@a:~# adduser rick staff
    adduser: The user `rick' does not exist.
    

    The group exists

    root@a:~# addgroup staff
    addgroup: The group `staff' already exists.
    

    The man page says this should work...

    adduser [options] user group
    

    Any ideas?

    I can do:

    adduser --ingroup staff rick
    

    So no massive issue, just seems strange.

    • Pricey
      Pricey over 12 years
      Could you pastebin man adduser? Seems odd...
  • sillyfem
    sillyfem over 12 years
    Thanks for the answer but I know how, im asking why the documented method of adduser does not work
  • ata
    ata over 12 years
    @Rob perhaps you are lookin for --gid or --ingroup ?
  • sillyfem
    sillyfem over 12 years
    As per my original question, --ingroup works fine, this is nothing to do with groups, I'm trying to raise that there's an issue with adduser [options] user group
  • sillyfem
    sillyfem over 12 years
    you're right, my bad, it's not clear from the man page but what im trying to run requires an existing user, so using --ingroup is what I want.