8

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?

7

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.

3

To answer the literal question: no, there is no default password. Usually by default an account will have an "invalid" password, that is, a password hash that will not be matched by any password at all. In order to be able to log in, a password must be explicitly specified, e.g. by running passwd for the account in question.

However, you can configure the logon manager to automatically log in as a specific user, either immediately or after a delay, if you wish to do so. That is not normally done, but the feature exists.

2

No, there is not. For every single user you create in the GUI you have to set manually the password. Blank passwords or default standard password are obviously considered as a high security risk.

But

You have the command newusers witch can help you create one or many users using the default password you want in plain text mode. usage as root : newusers file where file is a text file with the folowing structure for each line : pw_name:pw_passwd:pw_uid:pw_gid:pw_gecos:pw_dir:pw_shell

You can do it also in one command line. Example :

echo chinmay:clearpassword::::/home/maleki:/bin/bash | sudo newusers
0

No, there isn't a default password for users. The information you might want to read is the manual page for adduser

man adduser

This command uses useradd which is a lower level command.

  • 1
    That depends on the distro. In Debian adduser is it's own command. In RHEL, it's a symlink to useradd. – jordanm Jan 9 '14 at 15:18
0

There is no default password: either an account has a password, or it doesn't (in which case you can't log in, at least not with password authentication). However, you can set an empty password. Many services reject empty passwords, though. In particular, with an empty password, you won't be able to log in remotely. But you will be able to log in on the console.

Rather than use this feature, I recommend setting a reasonably strong password, and if you really don't want to have to type it because your computer stays at home and nobody but you accesses it, set up autologin. A passwordless account does make sense in some cases, such as children.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.