How to add a user to Ubuntu 12.04
12,577
You can add an new user (with the common options, and /home/[user]
as home directory) with:
useradd -m -g users -s /bin/bash [user]
and then to set a password:
passwd [user]
EDIT: You can also add additional information about the user with:
chfn [user]
Related videos on Youtube
Author by
Sina
Updated on September 18, 2022Comments
-
Sina over 1 year
This is very weird, when add a user using the command line then set a password I cant login using the GUI! is this a new thing or what?
-
Rinzwind almost 11 yearsDepends on the command used... 1 thing that is important: did you specify a /home?
-
Sina almost 11 yearsNo I didn't, I just used useradd with no options
-
-
Sina almost 11 yearsdoes this mean that useradd <new user> does not work unless I use the -m -g switches?
-
Sina almost 11 yearsThis is exactly what I did, it didn't work
-
João André almost 11 years
-m
creates you home folder in/home/[user]
, and-g
adds you to the groupsusers
, which I am not sure if is set by default. If you just useduseradd [user]
, then probably you would run into problems, as the GUI requires both. -
ispasov almost 11 yearsThen try to change the password. Use comand: sudo passwd username