51

I have created a new user by using useradd command e.g.:

sudo useradd acreddy

Then new user is created but it is asking for a password what is the password?

4
  • 4
    Start using adduser instead of useradd
    – heemayl
    Nov 9, 2015 at 5:33
  • 13
    There is no default password. When you create a user it does not have a password yet, so you cannot login with that username until you create a password. There is one other way to act as a new user without its password. As root type su - acreddy. It will not ask for password and you will be logged in as acreddy. But only in that terminal.
    – nobody
    Nov 9, 2015 at 6:37
  • 2
    @nobody it still asked me for the password even with -
    – Dan M.
    May 29, 2018 at 12:46
  • 3
    @DanM. You have to be root. So try sudo -i to switch to root. Then try sudo - <username>.
    – nobody
    May 30, 2018 at 13:55

2 Answers 2

51

You need to set a password for the user. Use the passwd command:

Usage: passwd [options] [LOGIN]

So if you want to set a password for the new user, you type in:

sudo passwd acreddy 

and you're good.

7

If you don't want to set password, you can do it by

passwd -d username

You must log in to answer this question.

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