Solved

Password History, Length

Posted on 2003-10-28
10
612 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
Comment Utility
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
Comment Utility
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
Comment Utility
.... As you'll note, there isn't any "maxlength", but there are parameters governing how many "significant" characters the modules operate on.

-- Glenn
0
 
LVL 2

Expert Comment

by:sam_sunder
Comment Utility
hi Ameet.

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

regards,

sam
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 20

Expert Comment

by:Gns
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thats true.. the reason, I put comments whats helped me & what is true :)
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This document is written for Red Hat Enterprise Linux AS release 4 and ORACLE 10g.  Earlier releases can be installed using this document as well however there are some additional steps for packages to be installed see Metalink. Disclaimer: I hav…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

762 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now