Linux是对用户的密码的复杂度要求设置【转】
那么Linux是如何实现对用户的密码的复杂度的检查的呢?其实系统对密码的控制是有两部分组成:
1 cracklib
2 /etc/login.defs
pam_cracklib.so 才是控制密码复杂度的关键文件/lib/security/pam_cracklib.so, Redhat公司专门开发了cracklib这个安装包来判断密码的复杂度。如果你想查看pam_cracklib的一些参数,那么就使用下面命令
[root@DB-Server security]# man pam_cracklib
其中一些常见的参数为
retry=N
改变输入密码的次数,默认值是1。就是说,如果用户输入的密码强度不够就退出。可以使用这个选项设置输入的次数,以免一切都从头再来 Prompt user at most N times before returning with error. The
default is minlen=N
新密码最低可接受的长度 The minimum acceptable size for the new password (plus one if
credits are not disabled which is the default). In addition to the
number of characters in the new password, credit (of + in length)
is given for each different kind of character (other, upper, lower
and digit). The default for this parameter is which is good for a
old style UNIX password all of the same type of character but may
be too low to exploit the added security of a md5 system. Note that
there is a pair of length limits in Cracklib itself, a "way too
short" limit of 4 which is hard coded in and a defined limit (6)
that will be checked without reference to minlen. If you want to
allow passwords as short as characters you should not use this
module. difok=N
默认值为10。这个参数设置允许的新、旧密码相同字符的个数。不过,如果新密码中1/2的字符和旧密码不同,则新密码被接受 This argument will change the default of for the number of
characters in the new password that must not be present in the old
password. In addition, if / of the characters in the new password
are different then the new password will be accepted anyway. dcredit=N
限制新密码中至少有多少个数字 (N >= ) This is the maximum credit for having digits in the new
password. If you have less than or N digits, each digit will count
+ towards meeting the current minlen value. The default for
dcredit is which is the recommended value for minlen less than
. (N < ) This is the minimum number of digits that must be met for a
new password. ucredit=N
限制新密码中至少有多少个大写字符。 lcredit=N
限制新密码中至少有多少个小写字符。
例如在/etc/pam.d/system-auth 在password使用pam_cracklib.so设置的最后附加dcredit=3 ucredit=2
password requisite pam_cracklib.so try_first_pass retry=3 dcredit=3 ucredit=2
password sufficient pam_unix.so md5 shadow nullok try_first_pass use_authtok
password required pam_deny.so
此时如果你新建用户的密码不符合密码复杂度,就会出现BAD PASSWORD: it is based on a dictionary word提示。
[root@DB-Server ~]# passwd ttt
Changing password for user ttt.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word 转自
Linux账户密码过期安全策略设置 - 潇湘隐者 - 博客园
http://www.cnblogs.com/kerrycode/p/5600525.html
Linux是对用户的密码的复杂度要求设置【转】的更多相关文章
- Linux系统root用户忘记密码解决方法
一:在linux系统启动时(如下图),按e键 二:进入到设置页面,定位到如下行: 三:按e键,进入输入界面 四:在编辑行最后面,空格,输入single,回车后回到第二步界面,只是后面多了single ...
- 【Hadoop系列】linux下 root用户免密码登录远程主机 ssh
SSH原理:[Hadoop系列]linux SSH原理解析 操作环境: CentOS 6.5 操作对象: 用户A主机和远程主机B 正文部分:斜体加粗代表linux指令. linux下 非root用户免 ...
- linux中普通用户修改密码出现(passwd:Authentication token manipulation error)
如果在linux中,不管是root用户还是普通用户登录后,修改自己的密码,出现---passwd:Authentication token manipulation error---错误的解决办法: ...
- Linux忘记root用户的密码
问题: 由于长时间没有操作过自己安装的虚拟机,导致连root用户的密码都忘了,也真是没谁了. 我使用的是centos6.5,今天就记录一下,如何重置root用户的密码. 操作步骤: 步骤一: 当开机启 ...
- linux修改root用户登陆密码
如果不是以root用户登录的,请先切换到root用户下, 执行命令:su root 然后按提示输入root用户的密码. 英文系统: [root@localhost ~]# passwd Changin ...
- linux系统root用户忘记密码的重置方法
如果不小心忘记了新安装的lCentOS7的root密码,现在将找回过程分享给大家. 1.首先,在启动grub菜单,选择编辑选项启动: 2.然后,按e 进入编辑模式: 3.将'linux 16'行'ro ...
- linux中ftp用户登录密码忘记了怎么修改
先来熟悉一下 vsftp 命令: 启动vsftp用命令: 1.service vsftpd start 重启vsftp用: www.111cn.net1.service vsftpd restart ...
- linux:如何修改用户的密码
1.首先,要用CRT软件连接Linux系统. 2.首选,确认是用root用户登录系统的. 输入命令: id ,查看登录用户信息. 3.若修改root自己的密码,直接输入 passwd . 输入两遍,新 ...
- 2、Linux系统root用户忘记密码的重置方式
.界面按空格暂停,按E .找到UTF-,在后面空格后输入init=/bin/sh 然后CHRL+X启动 .进入到这个界面,输入mount -o remount,rw / .输入passwd..然后输入 ...
随机推荐
- FZU2121_神庙逃亡
水题.直接解二次方程判断点的高度即可. #include <iostream> #include <cstring> #include <cstdio> #incl ...
- C++解析(2):进化后的 const 分析
0.目录 1.C语言中的const 2.C++中的const 3.对比 3.1 C语言与C++中的const 3.2 C++中的const与宏定义 4.小结 1.C语言中的const const修饰的 ...
- P3469 [POI2008]BLO-Blockade
题意翻译 在Byteotia有n个城镇. 一些城镇之间由无向边连接. 在城镇外没有十字路口,尽管可能有桥,隧道或者高架公路(反正不考虑这些).每两个城镇之间至多只有一条直接连接的道路.人们可以从任意一 ...
- Find the hotel HDU - 3193(RMQ)
题意: 有n个旅馆,从这n个旅馆中找出若干个旅馆,使得这若干个旅馆满足这样的条件:不能从其它和剩下的旅馆中找到一个价格和距离都小于这个旅馆的旅馆... 解析: 按price 排序,若price相同, ...
- window上安装elasticserach
提供一个百度云链接下载elasticsearch (链接:https://pan.baidu.com/s/1sk8PYjV 密码:l586) 测试达到目的:安装elasticsearch后再安装hea ...
- Linux内核分析4
周子轩原创作品转载请注明出处 <Linux内核分析>MOOC课程http://mooc.study.163.com/course/USTC-1000029000 使用库函数API和C代码 ...
- 很好的c++和Python混合编程文章
c++中嵌入python入门1 本人是用vc2003+python2.5学习的,其它的也应该差不了多少 0. 坏境设置把Python的include/libs目录分别加到vc的include/lib ...
- php 性能优化之opcache - 让你的php性能提升 50%
性能提升原理:减少文件解析的时间. 我们都知道,程序要运行,得有一个编译或者解析的过程,编译或解析之后的代码才是机器可以运行的. 而 php 是一种解析性语言,在使用php来处理http请求的时候,每 ...
- Servlet3.0 新特性
Servlet3.0 的注解 Servlet 允许开发人员采用注解的方式来配置 Servlet.Filter.Listener. Servlet3.0 规范在 javax.servlet.annota ...
- MyEclipse解决Launching xx on MyEclipse Tomcat has encountered a problem
单击工具栏Run,选中Run Configurations... 将MyEclipse Server Application里面的工程右击选择Delete就好了.