When I install the Ubuntu, I set a short password(<4). Now I want to change the other short password by "passwd" or change passphrase on "Password and Keys" program, it needs a password >4 char.
When I install the Ubuntu, I set a short password(<4). Now I want to change the other short password by "passwd" or change passphrase on "Password and Keys" program, it needs a password >4 char.
Use following command in Terminal:
Replace
<user>
with the username whose password you wish to change.This works because
passwd
suppresses all checks for length or entropy when you use it as the root user.By default, Ubuntu requires a minimum password length of 6 characters, as well as some basic entropy checks. These values are controlled in the file /etc/pam.d/common-password, which is outlined below.
If you would like to adjust the minimum length to 4 characters, add the appropriate variable (minlen=4) to the end of the line. The modification is outlined below.
Source.
Bring up a terminal and edit /etc/pam.d/common-password
Change this line:
to:
Password also need a certain amount of complexity, as specified by the obscure parameter above.
removes that check also.
This all presupposes that you think this is wise.
See
man pam_unix
These work on my system.
In Ubuntu 18.04 none of other solutions worked for me. I had to replace both of these lines:
in
/etc/pam.d/common-password
with:These changes let me changed my password easily and after changing password I restored file to it's original form.
To set up a simple password, I tried the simple
sudo passwd username
method, but it failed on my Ubuntu Server 12.04 LTS.So I tried to remove the
obscure
option from/etc/pam.d/common-passwd
config file, but it still failed.So I also removed the
obscure
option from/usr/share/pam-configs/unix
config file. And then it worked :-)I do agree that it should be simplier, when acting as
su
to set up a weak password, whatever the reason why one wants to do it! A warning saying "weak password, confirm?" would be perfect...This can be done with PAM pwdfile module.
The way described here changes only the desktop login (lightdm service), but can be applied to other services as well if you wish.
Also, this allows you to have your original strong password for "sudo", while maintaining a fairly easy way to login to Ubuntu desktop.
Commands can be issued in the terminal program.
Installing the software
First, we install a software package named
libpam-pwdfile
:Creating the user-password file
We will then create the user/password file. You will be prompted to enter a new PIN password. Your password will be encrypted and saved to a file named
passwd.like
Alternatively, you may use:
openssl passwd -1 yourpinpasswordhere
and create a file named /etc/passwd.like and that password.Setting up the desktop login service
The next step is to prepare the desktop login service to accept the PIN password before other password procedures. I've mentioned already the name of the desktop login service,
lightdm
.Take a look at the file:
If you don't have this file, then your desktop (login) service is a different one, and you should find your desktop manager before going further. As explained before, this guide is for Ubuntu 16.04 but can be used for other login services as well.
It could be useful if you also create a backup:
Now, you may edit the file using nano or gedit or any other text editor:
At the top of the file mine had:
I have modified it like so:
Save the file and close your text editor.
Log out and log back in.
You should be able to use the PIN password you set. By following this guide, the PIN password is only used for the desktop login service, not for the password of sudo commands.
Source: http://blog.radevic.com/2017/11/how-to-set-pin-password-or-short.html