Ubuntu – Is there some default password for a new user in Linux

passwordUbuntuusers

I am a Windows user gradually moving towards Linux. In Windows we have an option of either having or not having some password for a user. Once we do not put a password we can directly log in to the system.

However, in Linux this is not possible as every user must have a password. Even if one does not give a password not typing anything and simply pressing the Return key doesn't log one in (unlike Windows). Is there some default password set for every user or any other mechanism by means of which a password is always assigned?

Best Answer

Authentication can be handled in many different ways in Linux. Password authentication via /etc/passwd and /etc/shadow is the usual default. There is no default password.

A user is not required to have a password. In a typical setup a user without a password will be unable to authenticate with the use of a password. This is common for system users which are used to run daemons, but are not intended to be used directly by a human.

You can configure Linux to allow login to the desktop automatically, or allow login without a password. Authentication is done via PAM, which is highly configurable. The Arch wiki offers the following PAM configuration for login without a password:

If you want to bypass the password prompt in GDM then simply add the following line on the first line of /etc/pam.d/gdm-password:

auth sufficient pam_succeed_if.so user ingroup nopasswdlogin 

Then, add the group nopasswdlogin to your system. See Groups for group descriptions and group management commands. Now, add your user to the nopasswdlogin group and you will only have to click on your username to login.

Related Question