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..然后输入 ...
随机推荐
- 程序猿必备技能:数据库管理——关于MySQL
一.初识MySQL 1.什么是数据库? 数据库(Database,DB)简而言之就是存放数据的仓库,是为了实现一定目的,按照某种规则组织起来的数据的集合. 2.使用数据库的必要性 (1)结构化存储大量 ...
- static变量的特点 - 只会有一份成员对象
1. public class HasStatic{ 2. private static int x=100; 3. public static void main(String ...
- bzoj2969 矩形粉刷 概率期望
此题在bzoj是权限题,,,所以放另一个oj的链接 题解: 因为期望线性可加,所以可以对每个方格单独考虑贡献.每个方格的贡献就为至少被粉刷过一次的概率×1(每个格子的最大贡献就是1...)每个方格至少 ...
- bundle adjustment原理(1)转载
转自菠菜僵尸 http://www.cnblogs.com/shepherd2015/p/5848430.html bundle adjustment原理(1) 那些光束平差的工具,比如SBA.SSB ...
- 04-树5. File Transfer--并查集
对于一个集合常见的操作有:判断一个元素是否属于一个集合:合并两个集合等等.而并查集是处理一些不相交集合(Disjoint Sets)的合并及查询问题的有利工具. 并查集是利用树结构实现的.一个集合用一 ...
- POJ1011 木棒(dfs+剪枝)
问题重述: Description乔治拿来一组等长的木棒,将它们随机地砍断,使得每一节木棍的长度都不超过50个长度单位.然后他又想把这些木棍恢复到为裁截前的状态,但忘记了初始时有多少木棒以及木棒的初始 ...
- laravel query builder/ Eloquent builder 添加自定义方法
上次干这事已经是一年前了,之前的做法特别的繁琐.冗余,具体就是创建一个自定义 Builder 类,继承自 Query\Builder,然后覆盖 Connection 里面获取 Builder 的方法, ...
- C++时间
C++时间 头文件 chrono, 命名空间 std. 现在时间 std::chrono::system_clock::now() 返回系统时钟的当前时间 时钟 std::chrono::system ...
- mac和linux下sed使用的不同
http://note.youdao.com/noteshare?id=84a6a0eb3e3f1698c9de4f48db24226e
- lightoj 1020 (博弈水题)
lightoj 1020 A Childhood Game 链接:http://lightoj.com/volume_showproblem.php?problem=1020 题意:一堆石子有 m 个 ...