仓酷云

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 777|回复: 12
打印 上一主题 下一主题

[其他Linux] 给大家带来怎样设置PAM模块把持Linux暗码战略

[复制链接]
爱飞 该用户已被删除
跳转到指定楼层
楼主
发表于 2015-1-16 11:47:06 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
在学习初期,你一定会遇到很多困难,或者说各种困难,所以你最好先将你linux中的重要内容备份,因为,在你学习的过程中,很可能将系统搞废(eg:源混乱等);
我们在利用linux体系设置暗码的时分,常常碰到如许的成绩,体系提醒:您的暗码太复杂,大概您的暗码是字典的一部分。那末体系是怎样完成对用户的暗码的庞大度的反省的呢?
  体系对暗码的把持是有两部分(我晓得的)构成:
  1cracklib
  2login.defs
  声明:login.defs次要是把持暗码的无效期。对暗码举行工夫办理。此处不细谈
  login.defs--shadowpasswordsuiteconfiguration
  pam_cracklib.so才是把持暗码庞大度的关头文件
  redhat公司专门开辟了cracklib这个安装包来判别暗码的庞大度
  能够rpm-qlcracklib检察
  暗码的庞大度的判别是经由过程pam模块把持来完成的,详细的模块是pam_cracklibpam_cracklib的参数先容:
  debug
  Thisoptionmakesthemodulewriteinformationtosyslog(3)indicatingthebehaviorofthemodule(thisoptiondoesnotwritepasswordinformationtothelogfile).
  type=XXX
  Thedefaultactionisforthemoduletousethefollowingpromptswhenrequestingpasswords:"NewUNIXpassword:"and"RetypeUNIXpassword:".ThedefaultwordUNIXcanbereplacedwiththisoption.
  retry=N
  PromptuseratmostNtimesbeforereturningwitherror.Thedefaultis1
  difok=N
  Thisargumentwillchangethedefaultof5forthenumberofcharactersinthenewpasswordthatmustnotbepresentintheoldpassword.Inaddition,if1/2ofthecharactersinthenewpasswordaredifferentthenthenewpasswordwillbeacceptedanyway.
  difignore=N
  Howmanycharactersshouldthepasswordhavebeforedifokwillbeignored.Thedefaultis23.
  minlen=N
  Theminimumacceptablesizeforthenewpassword(plusoneifcreditsarenotdisabledwhichisthedefault).Inadditiontothenumberofcharactersinthenewpassword,credit(of+1inlength)isgivenforeachdifferentkindofcharacter(other,upper,loweranddigit).Thedefaultforthisparameteris9whichisgoodforaoldstyleUNIXpasswordallofthesametypeofcharacterbutmaybetoolowtoexploittheaddedsecurityofamd5system.NotethatthereisapairoflengthlimitsinCracklibitself,a"waytooshort"limitof4whichishardcodedinandadefinedlimit(6)thatwillbecheckedwithoutreferencetominlen.Ifyouwanttoallowpasswordsasshortas5charactersyoushouldnotusethismodule.
  dcredit=N
  (N>=0)Thisisthemaximumcreditforhavingdigitsinthenewpassword.IfyouhavelessthanorNdigits,eachdigitwillcount+1towardsmeetingthecurrentminlenvalue.Thedefaultfordcreditis1whichistherecommendedvalueforminlenlessthan10.
  (N<0)Thisistheminimumnumberofdigitsthatmustbemetforanewpassword.
  ucredit=N
  (N>=0)Thisisthemaximumcreditforhavinguppercaselettersinthenewpassword.IfyouhavelessthanorNuppercaseletterseachletterwillcount+1towardsmeetingthecurrentminlenvalue.Thedefaultforucreditis1whichistherecommendedvalueforminlenlessthan10.
  (N>0)Thisistheminimumnumberofuppercaselettersthatmustbemetforanewpassword.
  lc
123下一页


在linux中学习命令的最好办法是学习Shell脚本编程,Shell脚本比起其他语言来学习简单,但是功能却十分强大.通过学习Shell编程,能让你掌握大量的linux命令。
爱飞 该用户已被删除
沙发
 楼主| 发表于 2015-1-16 12:55:21 | 只看该作者

给大家带来怎样设置PAM模块把持Linux暗码战略

要多动手,不要怕什么搞坏了怎么办,你不搞坏,不去动手,就永远不会有收获,既然你在linux中是自由的,那就发挥自己的权利;
redit=N</P>  (N>=0)Thisisthemaximumcreditforhavinglowercaselettersinthenewpassword.IfyouhavelessthanorNlowercaseletters,eachletterwillcount+1towardsmeetingthecurrentminlenvalue.Thedefaultforlcreditis1whichistherecommendedvalueforminlenlessthan10.
  (N<0)Thisistheminimumnumberoflowercaselettersthatmustbemetforanewpassword.
  ocredit=N
  (N>=0)Thisisthemaximumcreditforhavingothercharactersinthenewpassword.IfyouhavelessthanorNothercharacters,eachcharacterwillcount+1towardsmeetingthecurrentminlenvalue.Thedefaultforocreditis1whichistherecommendedvalueforminlenlessthan10.
  (N<0)Thisistheminimumnumberofothercharactersthatmustbemetforanewpassword.
  use_authtok
  Thisargumentisusedtoforcethemoduletonotprompttheuserforanewpasswordbutusetheoneprovidedbythepreviouslystackedpasswordmodule.
  dictpath=/path/to/dict
  Pathtothecracklibdictionaries.
  dictpath=/path/to/dict//注:暗码字典,这个是考证用户的暗码是不是是字典一部分的关头。
  Pathtothecracklibdictionaries.
  cracklib暗码强度检测历程
  起首反省暗码是不是是字典的一部分,假如不是,则举行上面的反省
  暗码强度检测历程
  Thesechecksare:
  Palindrome
  Isthenewpasswordapalindromeoftheoldone?
  新暗码是不是旧暗码的回文
  CaseChangeOnly
  Isthenewpasswordthetheoldonewithonlyachangeofcase?
  新暗码是不是只是就暗码改动了巨细写
  Similar
  Isthenewpasswordtoomuchliketheoldone?
  新暗码是不是和旧暗码很类似
  Thisisprimarilycontrolledbyoneargument,difokwhichisanumberofcharactersthatifdifferentbetweentheoldandnewareenoughtoacceptthenewpassword,thisdefaultsto10or1/2thesizeofthenewpasswordwhicheverissmaller.
  Toavoidthelockupassociatedwithtryingtochangealongandcomplicatedpassword,difignoreisavailable.Thisargumentcanbeusedtospecifytheminimumlengthanewpasswordneedstobebeforethedifokvalueisignored.Thedefaultvaluefordifignoreis23.
  Simple
  Isthenewpasswordtoosmall?
  新暗码是不是太短
  Thisiscontrolledby5argumentsminlen,dcredit,ucredit,lcredit,andocredit.Seethesectionontheargumentsforthedetailsofhowtheseworkandtheredefaults.
  Rotated
  Isthenewpasswordarotatedversionoftheoldpassword?
  新暗码的字符是不是是旧暗码字符的一个轮回
  比方旧暗码:123
  新暗码:231
  Alreadyused
  Wasthepasswordusedinthepast?
  这个暗码之前是不是利用过
  Previouslyusedpasswordsaretobefoundin/etc/security/opasswd.
  那末体系是怎样完成这个把持的呢?
  在体系的设置文件/etc/pam.d/system-auth中有如许一行
  passwordrequisitepam_cracklib.sotry_first_passretry=3
  我们能够依据pam_cracklib的参数如许设置这个pam模块来到达我们想要的目标
  password
上一页123下一页


无论图形界面发展到什么水平这个原理是不会变的,Linux命令有许多强大的功能:从简单的磁盘操作、文件存取、到进行复杂的多媒体图象和流媒体文件的制作。
爱飞 该用户已被删除
板凳
 楼主| 发表于 2015-1-16 13:10:53 | 只看该作者

给大家带来怎样设置PAM模块把持Linux暗码战略

vim除非你打算真正的学好linux,或者说打算长久时间学习他,而且肯花大量时间vim,否则,最好别碰
required/lib/security/pam_cracklib.soretry=3type=minlen=8difok=3dictpath=/path/to/dict
</P></p>
上一页123


但不会命令而成为高手也是不可能的.这就好比学英语,什么语法都不懂,只捧着单词手册背单词是学不会英语的,但是没有单词词汇量英语水平也提不高的。
老尸 该用户已被删除
地板
发表于 2015-1-18 16:24:59 | 只看该作者
写学习日记,这是学习历程的见证,同时我坚持认为是增强学习信念的法宝。
因胸联盟 该用户已被删除
5#
发表于 2015-1-27 11:55:25 | 只看该作者
有疑问前,知识学习前,先用搜索。
飘灵儿 该用户已被删除
6#
发表于 2015-2-5 13:05:23 | 只看该作者
如果你有庞大而复杂的测试条件,尽量把它剪裁得越小越好。可能你会遇到这种情况,对于一个问题会出现不同内容回答,这时你需要通过实践来验证。
活着的死人 该用户已被删除
7#
发表于 2015-2-11 23:55:54 | 只看该作者
为什么要学Linux呢?每个人都有不同的看法,下面我说说自己的感想吧。?
精灵巫婆 该用户已被删除
8#
发表于 2015-3-2 21:39:21 | 只看该作者
随着Linux应用的扩展,出现了不少Linux社区。有一些非常优秀的社区往往是Linux高手的舞台,如果在探讨高级技巧的论坛张贴非常初级的问题经常会没有结果。
柔情似水 该用户已被删除
9#
发表于 2015-3-11 07:57:02 | 只看该作者
Linux操作系统这个名词记得在很早以前就听过,但当时并不知道具体是什么样的操作系统,只知道是一个与嵌入式密切相关的操作系统。
不帅 该用户已被删除
10#
发表于 2015-3-18 03:28:03 | 只看该作者
期间我阅读了不少关于Linux的相关资料,其中也不乏一些有趣的小故事,这既丰富了我的课余生活,也让我加深了对一些术语的理解,比玩游戏强多了。?
乐观 该用户已被删除
11#
发表于 2015-3-25 13:32:05 | 只看该作者
我学习Linux的心得体会 ,希望对大家的学习有所帮助,由于水平有限,本文难免有所欠缺,望请指正。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|仓酷云 鄂ICP备14007578号-2

GMT+8, 2024-5-30 21:17

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表