Saturday, April 27, 2024
 Popular · Latest · Hot · Upcoming
21
rated 0 times [  21] [ 0]  / answers: 1 / hits: 42985  / 1 Year ago, sat, january 21, 2023, 10:44:09

Is there any way to set up minimum passcode requirements, such as a minimum length, requirement of mixed case alphanumerics and at least 1 symbol in the passcode, and enforce that at passcode changes?


More From » security

 Answers
1

Password complexity in Ubuntu is controlled by PAM. Unfortunately, PAM is "typically Unix" like in its approach. Meaning that it spreads its configuration through a large number of very confusing files.



The file that controls password complexity is:



/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=12


or whatever minimum you want. As you can see, the default already defines some basic obscurity rules. These basic rules can be seen in:



man pam_unix


Search for "obscure".



There are a large number of pam modules that can be installed.



apt-cache search libpam-


Should show you them.



You will need to hunt down the documenation for them I'm afraid. But the "cracklib" is a common addition.



UPDATE: I should have pointed out that the default "obscure" parameter includes tests for complexity based on previous passwords and simplicity (length, number of different types of character). The example in the manpage shows cracklib in action. Install libpam_cracklib to get that working.



Also, once you have worked out what to change, the changes are the same in other files so that you can enforce the same (or different) password checks for SSH and other applications.


[#37236] Monday, January 23, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
oatglori

Total Points: 313
Total Questions: 102
Total Answers: 111

Location: Guam
Member since Thu, May 18, 2023
1 Year ago
oatglori questions
;