LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-09-2013, 04:55 PM   #1
abefroman
Senior Member
 
Registered: Feb 2004
Location: lost+found
Distribution: CentOS
Posts: 1,430

Rep: Reputation: 55
How do I change the minimum password length for crack-lib?


How do I change the minimum password length for crack-lib? (CentOS)

It looks like the default is 5:
Code:
root [/etc/pam.d]# echo "4l39ta" | cracklib-check
4l39ta: OK
root [/etc/pam.d]# echo "4l39t" | cracklib-check
4l39t: it is too short
root [/etc/pam.d]# man cracklib-check
No manual entry for cracklib-check
TIA
 
Old 09-09-2013, 09:23 PM   #2
netnix99
Member
 
Registered: Jun 2011
Distribution: redhat, CentOS, OpenBSD
Posts: 298

Rep: Reputation: 99
Look in /etc/pam.d/system-auth .....

password required /lib/security/pam_cracklib.so retry=3 minlen=5 dcredit=2 ucredit=2 lcredit=2 ocredit=2


minlen= is the field that you are looking for.... the *credit entries define (in this case) 2 uppercase, 2 lowercase, 2 digits, 2 other ...which increases password strength.... retrys is the number of failed attempts before locking the user account.

HTH
 
Old 09-09-2013, 09:38 PM   #3
abefroman
Senior Member
 
Registered: Feb 2004
Location: lost+found
Distribution: CentOS
Posts: 1,430

Original Poster
Rep: Reputation: 55
Thanks, that didn't seem to do it though, I changed the minlen to 8:
Code:
root [~]#  pico /etc/pam.d/system-auth
root [~]# echo "4l39tarr" | cracklib-check
4l39tarr: OK
root [~]# service sshd restart
Stopping sshd:                                             [  OK  ]
Starting sshd:                                             [  OK  ]
root [~]# echo "4l39tarr" | cracklib-check
4l39tarr: OK
root [~]# cat  /etc/pam.d/system-auth |grep cracklib
password    required     pam_cracklib.so try_first_pass retry=3 minlen=8 dcredit=2 ucredit=2 lcredit=2 ocredit=2
 
Old 09-09-2013, 10:53 PM   #4
netnix99
Member
 
Registered: Jun 2011
Distribution: redhat, CentOS, OpenBSD
Posts: 298

Rep: Reputation: 99
what happens if, as a user, you execute the command
Code:
passwd
and enter a password of 7 or less characters?
 
Old 09-09-2013, 11:07 PM   #5
abefroman
Senior Member
 
Registered: Feb 2004
Location: lost+found
Distribution: CentOS
Posts: 1,430

Original Poster
Rep: Reputation: 55
Quote:
Originally Posted by netnix99 View Post
what happens if, as a user, you execute the command
Code:
passwd
and enter a password of 7 or less characters?
Good question, I'm trying to use cracklib to valid password, not being entered in passwd though.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
password minimum length for specific user only in centos cptrojan101 Linux - Newbie 2 02-07-2013 06:51 PM
Minimum password length Domskis Linux - Newbie 4 10-20-2011 02:32 AM
Lock after invalid login attempts, session lock, minimum password length nstarz Linux - Security 1 06-24-2010 05:36 PM
Fedora FC3 --How do I change minimum username length heuristik Fedora 1 02-04-2005 02:06 AM
Setting Minimum Password Length (RH 7.1) zyft02 Linux - Newbie 1 02-26-2002 08:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration