Solved

Password History, Length

Posted on 2003-10-28
10
623 Views
Last Modified: 2007-12-19
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.

Thanks,
Ameet
0
Comment
Question by:ameetphanse
10 Comments
 
LVL 13

Accepted Solution

by:
rhinoceros earned 20 total points
ID: 9639736
1. The default has "minimum password length" setting only as I know
http://www.faqs.org/docs/securing/chap5sec31.html

2. No history by default

I hope it can help.
0
 
LVL 20

Expert Comment

by:Gns
ID: 9640687
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
#%PAM-1.0
auth       required     /lib/security/pam_stack.so service=system-auth
account    required     /lib/security/pam_stack.so service=system-auth
password   required     /lib/security/pam_stack.so service=system-auth
-----------
This shows that we need look at the "stacked" file /etc/pam.d/system-auth
----------- /etc/pam.d/system-auth
#%PAM-1.0
# This file is auto-generated.
# User changes will be destroyed the next time authconfig is run.
auth        required      /lib/security/pam_env.so
auth        sufficient    /lib/security/pam_unix.so likeauth nullok
auth        required      /lib/security/pam_deny.so

account     required      /lib/security/pam_unix.so

password    required      /lib/security/pam_cracklib.so retry=3 type=
password    sufficient    /lib/security/pam_unix.so nullok use_authtok md5 shadow
password    required      /lib/security/pam_deny.so

session     required      /lib/security/pam_limits.so
session     required      /lib/security/pam_unix.so
----------
The relevant line is the  
password    sufficient    /lib/security/pam_unix.so nullok use_authtok md5 shadow
line that you should change to read
password    sufficient    /lib/security/pam_unix.so 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
0
 
LVL 20

Expert Comment

by:Gns
ID: 9640693
.... As you'll note, there isn't any "maxlength", but there are parameters governing how many "significant" characters the modules operate on.

-- Glenn
0
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
LVL 2

Expert Comment

by:sam_sunder
ID: 9763085
hi Ameet.

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

regards,

sam
0
 
LVL 20

Expert Comment

by:Gns
ID: 9763153
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
0
 
LVL 20

Expert Comment

by:Gns
ID: 10183041
Point split between rhinoceros and me, if it were more than 20... As things stand, I'd say give'm to rhino.

-- Glenn
0
 

Author Comment

by:ameetphanse
ID: 10184037
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/pam_cracklib.so retry=3 minlen=6 type=
password    sufficient    /lib/security/pam_unix.so nullok use_authtok md5 shadow remember=6  
This system-auth entry has fixed History to 6 & minimum length to 6 as well.

Thanks Glenn !

Ameet
0
 
LVL 20

Expert Comment

by:Gns
ID: 10185086
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
0
 

Author Comment

by:ameetphanse
ID: 10185171
Thats true.. the reason, I put comments whats helped me & what is true :)
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question