Password History, Length

I want to set password history to 6 in Linux 8 Advanced Server systems as well as Max password length to 10. Does anyone know how to set it, so as user can not repeat his last 6 password. If you can give me file format, option details, will be helpfull.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

1. The default has "minimum password length" setting only as I know

2. No history by default

I hope it can help.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
CC rhino, there are minlength and "quality" parameters, but no maxlen.

Now, what distro is that? Linux is the kernel, so naming it conveys no information. The number eight has been used by many distros (as version identifier:-)... Suse has the version 8 Enterprise server, Mandrake have similar offerings... and RH has the Advanced Server but have only reached version 3 for that... So which one is it?

If your system is using pam, chances are great you'll be able to implement the "memory" function by simply adding "remember=6" to the pam_unix module spec, and "touch /etc/security/opasswd" so that it can store the old passwds (MD5 crypted) someqwhere safe... On a RedHat system the relevant files look like this (this is from a RH8 system):
----------- /etc/pam.d/passwd
auth       required     /lib/security/ service=system-auth
account    required     /lib/security/ service=system-auth
password   required     /lib/security/ service=system-auth
This shows that we need look at the "stacked" file /etc/pam.d/system-auth
----------- /etc/pam.d/system-auth
# This file is auto-generated.
# User changes will be destroyed the next time authconfig is run.
auth        required      /lib/security/
auth        sufficient    /lib/security/ likeauth nullok
auth        required      /lib/security/

account     required      /lib/security/

password    required      /lib/security/ retry=3 type=
password    sufficient    /lib/security/ nullok use_authtok md5 shadow
password    required      /lib/security/

session     required      /lib/security/
session     required      /lib/security/
The relevant line is the  
password    sufficient    /lib/security/ nullok use_authtok md5 shadow
line that you should change to read
password    sufficient    /lib/security/ nullok use_authtok md5 shadow remember=6
And then you should
touch /etc/security/opasswd
or else it'll claim that _all_ passwords have been previously used (not for root though, since root isn't checked... Not even when doing "passwd user").

You might also like to look at the docs for pam_unix and pam_cracklib ... you probably have some to-the-point READMEs in /usr/share/doc/pam-*/txts/, as well as the complete pam docs in the directory above.

-- Glenn
.... As you'll note, there isn't any "maxlength", but there are parameters governing how many "significant" characters the modules operate on.

-- Glenn
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

hi Ameet.

You can change the password configuration in /etc/login.defs. I could not understand what you meant by History.


No sam, login does not use login.defs... useradd does. Kind of counterintuitive:-). On most systems login/passwd uses PAM, which enforce the password lilimts through the modules mentioned above.

-- Glenn
Point split between rhinoceros and me, if it were more than 20... As things stand, I'd say give'm to rhino.

-- Glenn
ameetphanseAuthor Commented:
Glenn's Answeris perfect. I have set it by usiing pam.d/system-auth & passwd files. I wated to click on "Accept" to his answer. As I am new to use this site, made wrong accept selection.

maxlength is not set & I guess it is not possible.
password    required      /lib/security/ retry=3 minlen=6 type=
password    sufficient    /lib/security/ nullok use_authtok md5 shadow remember=6  
This system-auth entry has fixed History to 6 & minimum length to 6 as well.

Thanks Glenn !

Ok... You should place a question referensing this one in the "Community Supoort" area if you'd like to change that "missclick".
But it's OK by me if you let things stand as they are. Points aren't everything (far from it, most experts "do this" for fun!), knowing that it helped you is though (that warm feeling of satisfaction:-).

-- Glenn
ameetphanseAuthor Commented:
Thats true.. the reason, I put comments whats helped me & what is true :)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.