Configuration Files for User Management Defaults  

When working with tools as useradd, some default values are assumed. These default values are set in two configuration files: /etc/login.defs and /etc/default/ useradd.

[root@rhel7 ~]# cat /etc/default/useradd
# useradd defaults file
GROUP=
HOME=/home
INACTIVE=-
EXPIRE=
SHELL=/bin/bash
SKEL=/etc/skel
CREATE_MAIL_SPOOL=yes

the /etc/default/useradd file contains some default values that are applied when using useradd.

In the file /etc/login.defs, different login-related variables are set. This file is used by different commands, and it relates to setting up the appropriate environment for new users.

[root@rhel7 ~]# 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
PASS_MIN_DAYS
PASS_MIN_LEN
PASS_WARN_AGE #
# Min/max values for automatic uid selection in useradd
#
UID_MIN
UID_MAX
# System accounts
SYS_UID_MIN
SYS_UID_MAX #
# Min/max values for automatic gid selection in groupadd
#
GID_MIN
GID_MAX
# System accounts
SYS_GID_MIN
SYS_GID_MAX #
# 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 .
UMASK # This enables userdel to remove user groups if no members exist.
#
USERGROUPS_ENAB yes # Use SHA512 to encrypt password.
ENCRYPT_METHOD SHA512

Here is a list of some of the most significant properties that can be set from /etc/login.defs:

■    MOTD_FILE:     Defines the file that is used as “message of the day” file. In this file, you can include messages to be displayed after the user has successfully logged in to the server.    
 ■    ENV_PATH:     Defines the $PATH variable, a list of directories that should be searched for executable files after logging in.    
 ■    PASS_MAX_DAYS, PASS_MIN_DAYS, and PASS_WARN_AGE:     Define the default password expiration properties when creating new users.    
 ■    UID_MIN:     The first UID to use when creating new users.    
 ■    CREATE_HOME:     Indicates whether or not to create a home directory for new users.    
 ■    USERGROUPS_ENAB:     Set to yes to create a private group for all new users. That means that a new user has a group with the same name as the user as its default group. If set to no, all users are made a member of the group users.

与useradd命令相关的两个默认配置文件的更多相关文章

  1. useradd 命令 及 相关文件解读

    翻译自 man useradd 名称: 创建新用户或更新默认的新用户信息 快照:useradd -D 描述: 在不加-D参数调用时,useradd命令使用指定的参数和系统的默认值来创建新账户. 取决于 ...

  2. linux useradd 命令基本用法

    在 Linux 中 useradd 是个很基本的命令,但是使用起来却很不直观.以至于在 Ubuntu 中居然添加了一个 adduser 命令来简化添加用户的操作.本文主要描述笔者在学习使用 usera ...

  3. Linux中exec命令相关

    Linux中exec命令相关 exec和source都属于bash内部命令(builtins commands),在bash下输入man exec或man source可以查看所有的内部命令信息. b ...

  4. linux命令详解之useradd命令

    useradd命令使用方法,还包括用户账号的添加.删除与修改.用户口令的管理.用户组的管理方法. Linux系统是一个多用户多任务的分时操作系统,任何一个要使用系统资源的用户,都必须首先向系统管理员申 ...

  5. Linux指令--性能监控和优化命令相关指令

    原文出处:http://www.cnblogs.com/peida/archive/2012/12/05/2803591.html.感谢作者无私分享 性能监控和优化命令相关指令有:top,free,v ...

  6. useradd 命令的常见用法

    在Linux系统中 useradd 是个很基本的命令,但是使用起来却很不直观.以至于在 Ubuntu 中居然添加了一个 adduser 命令来简化添加用户的操作.本文主要描述笔者在学习使用 usera ...

  7. linux命令详解之useradd命令使用方法[linux下 添加用户、删除用户、修改用户密码、用户组管理]

    http://www.jb51.net/article/45848.htm Linux 系统是一个多用户多任务的分时操作系统,任何一个要使用系统资源的用户,都必须首先向系统管理员申请一个账号,然后以这 ...

  8. (转)linux命令详解之useradd命令使用方法

    linux命令详解之useradd命令使用方法 原文:http://blog.csdn.net/u011537073/article/details/51987121 Linux 系统是一个多用户多任 ...

  9. Linux 中useradd命令的使用

    Linux 系统中通常都是root用户具有超级权限,超级用户root一般是不需要创建的,然而很多时候root用户不是任何人都可以使用的,毕竟最高权限的用户,任意使用的话,会对系统造成很多不必要的破坏. ...

随机推荐

  1. Python list 常用操作

    测试版本: python 2.7 获取第一个.最后一个元素 list1 = ["a", "b", "c"] len1 = len(list1 ...

  2. 用jquery修改默认的单选框radio或者复选框checkbox选择框样式

    默认的radio和checkbox选框很难看.我去看了一下qq注册的页面.发现单选和复选框并没有用<input>,居然是用是A标签.然后用css背景图片展示选择框,用JavaScript控 ...

  3. Smarty 模板引擎 fetch()和display()函数的区别?

    Smarty模板函数里面有这样一个方法:fetch("template.htm"),他和display("template.htm");最大的不同就是fetch ...

  4. HTML&CSS基础学习笔记1.32-选择器是什么

    选择器是什么 选择器是CSS样式为了定位页面上的任意元素的一种方法. 选择器主要分为:元素标签选择器.通用选择器.类选择器.ID选择器.属性选择器.组合选择器.伪类选择器.伪元素选择器. 先做个了解, ...

  5. Python数据类型list(列表)和tuple(元组)

    list Python内置的一种数据类型是列表:list.list是一种有序的集合,可以随时添加和删除其中的元素. 比如,列出班里所有同学的名字,就可以用一个list表示: >>> ...

  6. [Struts2学习笔记] -- 环境配置

    在创建好WebProject后,就可以开始进行Struts2的环境配置,可以到Struts2官网下载,本环境使用struts-2.3.24.1版本. 首先导入必要的jar包到WebProject的/W ...

  7. C语言结构体占用空间内存大小解析

    结构体的数据类型的有点我们就不啰嗦了,直接来看相同数据结构体的几种书写的格式吧. 格式一: 01.struct tagPhone 02.{ 03.     char   A; 04.     int  ...

  8. 线程间操作无效: 从不是创建控件“textBox2”的线程访问它

    如何:对 Windows 窗体控件进行线程安全调用 线程间操作无效: 从不是创建控件的线程访问它的三种方法 如果使用多线程处理来提高 Windows 窗体应用程序的性能,则你必须确保以线程安全的方式调 ...

  9. 实验一:C语言实现DES加解密算法

    计算程序执行10万次需要的时间: 总共需要175秒 加解密一次的时间小于:0.00175秒 纯计算加解密的时间会更短 去除IO操作后的时间 也就是说加解密一次的时间为0.07毫秒 /*-------- ...

  10. IPv6-only 的兼容性解决方案-b

    前几天Apple宣布 6月1日后所有应用必须支持IPv6-only网络 今天抽空看了下这方面的知识 首先解释下IPv6的是什么? 维基百科的定义如下:IPv6是Internet Protocol ve ...