Solved

Password History, Length

Posted on 2003-10-28
10
626 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
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
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!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
High Bandwidth Usage 6 76
VMware Workstation 12 Player 16 133
Linux server had an unexpected freeze. How to find out cause (sys logs)? 13 47
Samba 4, Users Permission, 5 51
Fine Tune your automatic Updates for Ubuntu / Debian
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

821 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