useradd not asking for a password?
11,839
Solution 1
It is better to create new users with adduser
instead of useradd
. In this way you won't have this problem.
Solution 2
to set a password for the new user I ran
sudo passwd testuser
Solution 3
you can set the password with the root user after creating the user
root@yourpc:~# sudo passwd username
don't forget to run it on the root user. or you can just create your user with adduser
that asks password itself.
For some reasons like -gid
you might need to run the first command.
Related videos on Youtube
Comments
-
Mo. almost 2 years
I created new users from the terminal using
sudo useradd -g mygroup testuser
but I wasn’t prompted to set a password? why was that? the users have now been created but I need to set a password for them, so how can I do this?Thanks
-
AliN almost 10 yearsPossible duplicate of askubuntu.com/questions/462016/ubuntu-14-04-new-user-account
-
muru almost 10 yearsUse
adduser
instead: askubuntu.com/questions/345974/…
-
-
matigo about 3 yearsHow is this different from Mo’s answer seven years ago? 🤔
-
Alireza Bahrami about 3 yearsits a whole lot different, more detail it has. I encountered this and I found this answer more complete. your welcome to ignore it :))