`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
Related videos on Youtube
Comments
-
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 grouproot@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 over 12 yearsCould you pastebin
man adduser
? Seems odd...
-
-
sillyfem over 12 yearsThanks for the answer but I know how, im asking why the documented method of
adduser
does not work -
ata over 12 years@Rob perhaps you are lookin for --gid or --ingroup ?
-
sillyfem over 12 yearsAs 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 over 12 yearsyou'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.