Difference between revisions of "Implement password character or length constraints"

From Notes_Wiki
(Created page with "=Implement password character or length constraints= We can implement minimum password length, password should have at least one small letter, etc. constraints by editing <tt...")
 
m
Line 1: Line 1:
<yambe:breadcrumb self="Implement password character or length constraints">Miscellaneous OS configuration|Miscellaneous OS configuration</yambe:breadcrumb>
=Implement password character or length constraints=
=Implement password character or length constraints=


Line 15: Line 16:
*To set some minimum length for each type use values -1, -2 etc.
*To set some minimum length for each type use values -1, -2 etc.
*All the characters have one credit by default. If we want to increases credit of characters then we can set some positive value for above parameters. For example if we use '<tt>minlen=6 lcredit=1 ucredit=2</tt>' then we would need six characters password consisting of only digits OR we would need three letter password consisting of only small letters OR we would need two letter password consisting of only capital letters to make total 6 credits. Note that 1 credit is there for each character by default, and additional credits can be defined by giving positive values to parameters like lcredit, ucredit, etc.
*All the characters have one credit by default. If we want to increases credit of characters then we can set some positive value for above parameters. For example if we use '<tt>minlen=6 lcredit=1 ucredit=2</tt>' then we would need six characters password consisting of only digits OR we would need three letter password consisting of only small letters OR we would need two letter password consisting of only capital letters to make total 6 credits. Note that 1 credit is there for each character by default, and additional credits can be defined by giving positive values to parameters like lcredit, ucredit, etc.
<yambe:breadcrumb self="Implement password character or length constraints">Miscellaneous OS configuration|Miscellaneous OS configuration</yambe:breadcrumb>

Revision as of 07:46, 21 August 2018

<yambe:breadcrumb self="Implement password character or length constraints">Miscellaneous OS configuration|Miscellaneous OS configuration</yambe:breadcrumb>

Implement password character or length constraints

We can implement minimum password length, password should have at least one small letter, etc. constraints by editing /etc/pam.d/system-auth file. In this file edit following line:

password requisite pam_cracklib.so retry=3 minlen=9 lcredit=-1 ucredit=-1 dcredit=-1 ocredit=-1

where:

  • lcredit is for lower case letters
  • ucredit is for upper case letters
  • dcredit is for digits
  • ocredit is for other characters, ie, 'o' in ocredit is stands for other


Configuration is done as follows:

  • To set some minimum length for each type use values -1, -2 etc.
  • All the characters have one credit by default. If we want to increases credit of characters then we can set some positive value for above parameters. For example if we use 'minlen=6 lcredit=1 ucredit=2' then we would need six characters password consisting of only digits OR we would need three letter password consisting of only small letters OR we would need two letter password consisting of only capital letters to make total 6 credits. Note that 1 credit is there for each character by default, and additional credits can be defined by giving positive values to parameters like lcredit, ucredit, etc.


<yambe:breadcrumb self="Implement password character or length constraints">Miscellaneous OS configuration|Miscellaneous OS configuration</yambe:breadcrumb>