15、login.defs(默认)登录和Linux默认权限设置(密码复杂度,相关安全设置)

[[email protected] ~]# cat /etc/login.defs

Please note that the parameters in this configuration file control the

behavior of the tools from the shadow-utils component. None of these

tools uses the PAM mechanism, and the utilities that use PAM (such as the

passwd command) should therefore be configured elsewhere. Refer to

/etc/pam.d/system-auth for more information.

#

REQUIRED

Directory where mailboxes reside, or name of file, relative to the

home directory. If you do define both, MAIL_DIR takes precedence.

QMAIL_DIR is for Qmail

#
#QMAIL_DIR Maildir
MAIL_DIR /var/spool/mail
#MAIL_FILE .mail

Password aging controls:

#

PASS_MAX_DAYS Maximum number of days a password may be used.

PASS_MIN_DAYS Minimum number of days allowed between password changes.

PASS_MIN_LEN Minimum acceptable password length.

PASS_WARN_AGE Number of days warning given before a password expires.

#
PASS_MAX_DAYS 99999
PASS_MIN_DAYS 0
PASS_MIN_LEN 5
PASS_WARN_AGE 7

#

Min/max values for automatic uid selection in useradd

#
UID_MIN 500
UID_MAX 60000

#

Min/max values for automatic gid selection in groupadd

#
GID_MIN 500
GID_MAX 60000

#

If defined, this command is run when removing a user.

It should remove any at/cron/print jobs etc. owned by

the user to be removed (passed as the first argument).

#
#USERDEL_CMD /usr/sbin/userdel_local

#

If useradd should create home directories for users by default

On RH systems, we do. This option is overridden with the -m flag on

useradd command line.

#
CREATE_HOME yes

The permission mask is initialized to this value. If not specified,

the permission mask will be initialized to 022.

UMASK 077

This enables userdel to remove user groups if no members exist.

#
USERGROUPS_ENAB yes

Use SHA512 to encrypt password.

ENCRYPT_METHOD SHA512

在linux,设置密码复杂度的方法有几个

  1. 一个是在/etc/login.defs文件,里面几个选项
    PASS_MAX_DAYS 90 #密码最长过期天数
    PASS_MIN_DAYS 80 #密码最小过期天数
    PASS_MIN_LEN 10 #密码最小长度
    PASS_WARN_AGE 7 #密码过期警告天数
  2. 另外一个方法是,修改/etc/pam.d/system-auth文件
    找到 password requisite pam_cracklib.so这么一行替换成如下:
    password requisite pam_cracklib.so retry=5 difok=3 minlen=10 ucredit=-1 lcredit=-3 dcredit=-3 dictpath=/usr/share/cracklib/pw_dict
    不需要在pw_dict后面加.pwd,因为默认会带的
    [[email protected] ~]# passwd test
    Changing password for user test.
    New password:
    /usr/share/cracklib/pw_dict.pwd.pwd: No such file or directory

参数含义:
尝试次数:5
最少不同字符:3
最小密码长度:10
最少大写字母:1
最少小写字母:3
最少数字:3
密码字典:/usr/share/cracklib/pw_dict

这样设置好,你可以做一下测试,不过需要先退出root,因为root用户并不会受这些限制,它可以设置任意的密码。

密码复杂性原则:数字,大写,小写,特殊字符
实例如下:

原文地址:http://blog.51cto.com/425319153/2092982

时间: 2024-07-31 11:26:40

15、login.defs(默认)登录和Linux默认权限设置(密码复杂度,相关安全设置)的相关文章

linux加固安全之密码复杂度

随着linux系统使用的普遍性,对linux用户及系统安全要求也随之提升,单纯从单位制度,用户安全意识上来规范,并不能杜绝弱口令,必须从技术上要求用户定时修改复杂的密码,从而提高用户和系统的安全性. 密码策略的2个基本 一个密码最长使用期限,另一个是密码复杂度:这两个分别是/etc/login.defs 和/etc/pam.d/system-auth来控制. 1. vi /etc/login.defs PASS_MAX_DAYS 90 #密码最长使用期限 PASS_MIN_DAYS 5 #密码最

Linux用户权限管理和组管理相关命令

目标 用户 和 权限 的基本概念 用户管理 终端命令 组管理 终端命令 修改权限 终端命令 01. 用户 和 权限 的基本概念 1.1 基本概念 用户 是 Linux 系统工作中重要的一环,用户管理包括 用户 与 组 管理 在 Linux 系统中,不论是由本机或是远程登录系统,每个系统都必须拥有一个账号,并且对于不同的系统资源拥有不同的使用权限 在 Linux 中,可以指定 每一个用户 针对 不同的文件或者目录 的 不同权限 对 文件/目录 的权限包括: 序号 权限 英文 缩写 数字代号 01

linux下查看账号密码的过期时间和设置时间

[[email protected] myshell]# chage -l Usage: chage [options] [LOGIN] Options: -d, --lastday LAST_DAY set date of last password change to LAST_DAY -E, --expiredate EXPIRE_DATE set account expiration date to EXPIRE_DATE -h, --help display this help mes

linux设置密码过期时间/etc/login.defs

Linux下对于新添加的用户,用户密码过期时间是从 /etc/login.defs 中 PASS_MAX_DAYS 提取的,普通系统默认就是99999,而有些安全操作系统是90.更改此处,只是让新建的用户默认密码过期时间变化,已有用户密码过期时间仍然不变. [[email protected] ~]# chage --helpUsage: chage [options] user Options:  -d, --lastday LAST_DAY        set last password

CAS—修改默认登录页

1.  部署CAS-Server 本文以cas-server-3.4.11-release.zip为例,解压提取cas-server-3.4.11/modules/cas-server-webapp-3.4.11.war文件.然后,解压一个新的tomcat,我的目录为[H:\常用软件\03. Java\tomcat\apache-tomcat-6.0.33],然后把上面提取的文件copy到 [H:\常用软件\03. Java\tomcat\apache-tomcat-6.0.33\webapps

CAS—改动默认登录页

1.  部署CAS-Server 本文以cas-server-3.4.11-release.zip为例.解压提取cas-server-3.4.11/modules/cas-server-webapp-3.4.11.war文件.然后,解压一个新的tomcat,我的文件夹为[H:\经常使用软件\03. Java\tomcat\apache-tomcat-6.0.33],然后把上面提取的文件copy到 [H:\经常使用软件\03. Java\tomcat\apache-tomcat-6.0.33\we

Linux /etc/login.defs配置文件

login.defs是设置用户帐号限制的文件,在这里我们可配置密码的最大过期天数,密码的最大长度约束等内容.该文件里的配置对root用户无效.如果/etc/shadow文件里有相同的选项,则以/etc/shadow里的设置为准,也就是说/etc/shadow的配置优先级高于/etc/login.defs [[email protected] ~]# cat /etc/login.defs # # Please note that the parameters in this configurat

什么是默认登录shell,如何改变指定用户的登录shell?

在Linux操作系统,“/bin/bash”是默认登录shell,是在创建用户时分配的.使用chsh命令可以改变默认的shell.示例如下所示: #chsh <username> -s <new_default_shell> chsh linuxtchi -s /bin/sh 原文地址:https://www.cnblogs.com/sea-stream/p/12003090.html

改变linux默认配色方案(dircolors和dircolors-solarized使用)

前言 前几天刚买了阿里云的云服务器,今天使用putty进入服务器,发现linux默认的bash配色实在太丑. 特别是文件夹显示为深蓝色,到了白天,和黑色背景一搭配,根本看不清文字. 好在在github上找到了配色解决方案,dircolors-solarized 使用方法 1.将配色方案clone到本地 git clone https://github.com/seebi/dircolors-solarized.git (需要先安装git,没有安装的先在shell里运行命令apt-get inst