1

I don't understand why on my Ubuntu install there is such a small password character restriction. I think it's about 13 characters. Is there a way to modify Ubuntu so that I can have much longer passwords?

2
  • No I mean modify the OS so I can have say 20 characters. I will never leave Ubuntu I love it now!
    – john smith
    Jul 3, 2015 at 7:07
  • I am not sure if this works for Ubuntu, but according to this source, you should edit your /etc/pam.d/common-password file and modify the line containing pam_unix.so by adding the words max=20 between obscure and sha512 (or similar). Please report if it worked and I will convert this to an answer.
    – Byte Commander
    Jul 3, 2015 at 7:30

1 Answer 1

1

Password complexity in Ubuntu is controlled by PAM.

man pam_unix

   pam_unix - Module for traditional password authentication

   This is the standard Unix authentication module. It uses standard calls
   from the system's libraries to retrieve and set account information as
   well as authentication. Usually this is obtained from the /etc/passwd
   and the /etc/shadow file as well if shadow is enabled.

Open the file that controls password complexity:

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

There is a line:

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

Which defines the basic rules for password complexity. You can add a minimum length override by changing it to:

password [success=1 default=ignore] pam_unix.so obscure sha512 minlen=20

Replace 20 with min numb of characters you want to use for your password save and exit.

Read this and this to learn more about PAM.

3
  • Thanks. Are you sure it is the minimum value you have to change? I wanted to just increase the maximum amount of characters allowed to be greater than the defaults.
    – john smith
    Jul 3, 2015 at 12:02
  • then change minlen and write maxlen
    – Maythux
    Jul 3, 2015 at 15:45
  • @johnsmith you are welcome
    – Maythux
    Jul 4, 2015 at 5:59

You must log in to answer this question.

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