6

I can't set a short password in the user change password.

Additionally, I tried implementing the solutions of question, but none of them worked for me.

enter image description here

3 Answers3

9

Run sudo passwd <your-username> from the terminal. When run by root (sudo), passwd program should ignore all password policies set in PAM configuration. It will complain that the password does not meet the requirements, but will set it anyway.

raj
  • 10,353
2
root@dlp:~# vi /etc/security/pwquality.conf
# line 11 : uncomment and set minimum length (example below means 8 char)

minlen = 8

source: https://www.server-world.info/en/note?os=Ubuntu_22.04&p=pam&f=1

1

I can't set a short password in the user change password.

Correct. It follows the "password policy" set for all Linux systems:

By default, all Linux operating systems requires password length of minimum 6 characters for the users.

If you really want to change it use this:

sudo nano /etc/pam.d/common-password

and find this line:

password        [success=1 default=ignore]      pam_unix.so obscure yescrypt

and add minlen=N where N is the minimal length you want it to be. Default is 6.

If all you want is to change the password to a short one please do stay away from editing it. It is easier to just use command line for this. It needs to be like this to bypass password policies:

sudo passwd $USER

Plain passwd will also complain about the length (it uses the same setting as above)

Rinzwind
  • 299,756