Linux /etc/login.defs配置文件
login.defs是设置用户帐号限制的文件,在这里我们可配置密码的最大过期天数,密码的最大长度约束等内容。该文件里的配置对root用户无效。如果/etc/shadow文件里有相同的选项,则以/etc/shadow里的设置为准,也就是说/etc/shadow的配置优先级高于/etc/login.defs
[root@w ~]# 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 注:创建用户时,要在目录/var/spool/mail中创建一个用户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为500,也就是说添加用户时,UID是从500开始的,就是这个地方控制
UID_MAX 60000 注:最大UID为60000;
#
# Min/max values for automatic gid selection in groupadd
#
GID_MIN 500 注:GID依然是从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 注:是否创建用户家目录,默认要求创建,可用-m参数来控制
# 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 注:MD5密码加密
Linux /etc/login.defs配置文件相关推荐
- linux 新建用户配置文件 /etc/login.defs 简介
/etc/login.defs 是设置用户帐号限制的文件.该文件里的配置对root用户无效./etc/login.defs 文件用于在Linux创建用户时,对用户的一些基本属性做默认设置,例如指定用户 ...
- Linux用户与用户组配置文件详解
Linux用户与用户组配置文件详解 出发点 Linux是一个多用户多任务的操作系统,用户需要使用系统,就必须在系统中拥有属于自己的账号. 作为一个Linux管理员,对用户增删改查等操作当然离不开用户与 ...
- linux etc login.def,Linux-用户管理命令
用户的分类(CentOS7) 用户UID 系统含义 0 超级用户(拥有系统的最高权限) 1-200 系统用户,由系统分配给系统进程使用 201-999 系统用户,运行服务,不需要登录系统的 1000+ ...
- Linux系统的各配置文件用途介绍
本文将对Linux系统的各配置文件用途进行介绍,有助于你对linux系统配置文件有一个比较全面的理解. 内核本身也可以看成是一个"程序".为什么内核需要配置文件?内核需要了解系统中 ...
- linux vim python配置文件,Linux VIM8 Python 编辑器配置文件
Linux VIM8 Python3 编辑器配置文件 "---------------------简单配置------------------------- set nocompatible ...
- Linux安装mysql默认配置文件位置
Linux安装mysql默认配置文件位置 在linux下面安装mysql8.0 如果在/etc下面没有my.cnf配置文件 解决方式如下: 通过which mysqld 命令查看mysql的安装位置 ...
- linux bashrc文件,bashrc配置文件是什么?linux如何编辑bashrc配置文件?
linux如何编辑bashrc配置文件?使用macOS或Linux发行版的用户可能都发现了,在电脑用户主目录中有许多的隐藏文件,其中.bashrc的配置文件最为常用,通过编辑bashrc配置文件可以提 ...
- linux etc passwd权限,Linux中/etc/passwd配置文件详解
原标题:Linux中/etc/passwd配置文件详解 /etc/passwd文件: 系统用户配置文件,存储了系统中所有用户的基本信息,并且所有用户都可以对此文件执行读(r)操作. 查看文件内容: / ...
- linux ssh远程登录 配置文件 sshd_config 介绍
SSH由客户端和服务端的软件组成,在客户端可以使用的软件有SecureCRT.putty.Xshell等, 而在服务器端运行的是一个sshd的服务,通过使用SSH,可以把所有传输的数据进行加密,而且也 ...
最新文章
- Oracle的一些经典SQL面试题
- Visual Studio使用技巧,创建自己的代码片段
- 人工智能与主体时代变革
- 麻烦的.text字段
- SAP 选择屏幕的收起与展开(Collapse and Expand)
- Linux shell 进制转换
- vue 获取元素在浏览器的位置_前端开发JS获取页面元素的位置
- GitHub建立个人网站(二)
- android udp rtp播放器,IjkPlayer For Android(3)-RTP直播硬解码支持
- vue中axios设置表单头_VUE项目axios请求头更改Content-Type操作
- bk3432开发的应用实例_SpringCloud应用在Kubernetes上的最佳实践—诊断(线上联调)...
- 关于mapper接口与mapper.xml文件在同包运行找不到问题解决
- Linux 命令(16)—— chattr 与 lsattr 命令
- 力扣-33 搜索旋转排序数组
- ***编程DIY (Delphi版) - 第2篇 单实例运行
- 张小龙2019微信公开课演讲实录
- [剑指offer]-导航总结篇
- 飞机大战源码php,飞机大战源码 - 丁小未的个人页面 - OSCHINA - 中文开源技术交流社区...
- file_get_contents
- php手机编程ios,在iOS上实现生产力级别PHP编程
热门文章
- JQuery模拟二------添加extend函数和简单选择器
- Mono for Android 4.2初探
- 使用python开发windows应用程序
- atomic的安全性?
- spring session spring:session:sessions:expires 源码跟踪
- Eclipse添加JBOSS支持
- 驱动重构SDN/NFV奠定未来网络基石
- 第一课.axis配置和写法入门
- LeetCode(160): Intersection of Two Linked Lists
- scanf()和getchar() 使用