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. Asp.net MVC 与 Asp.net Web API 区别

    Asp.Net Web API VS Asp.Net MVC 1.Asp.net MVC 是用来创建返回视图(Views)与数据的Web应用,而Asp.net Web API是一种简单轻松地成熟的HT ...

  2. 在fragment中获取他附着的activity中的变量

    final String data=(关联的activity类)getActivity().getData(); getData();自定义的方法

  3. php中的双引号和单引号的区别?

    1.单引号里面的字符串直接全部转义,原样输出(即:单引号内部的变量不会被执行) 2.双引号里面的变量会被替换(即:变量会执行) 例如:$name = 'hello';echo "the $n ...

  4. jquery easy ui 学习 (1)Basic Window

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...

  5. JQuery Dialog(JS模态窗口,可拖拽的DIV) 效果实现代码

    效果图 调用示意图   交互示意图 如上图所示,这基本是JQueryDialog的完整逻辑流程了. 1.用户点击模态窗口的“提交”按钮时,调用JQueryDialog.Ok()函数,这个函数对应了用户 ...

  6. Memcached-1.4.4启动参数——手动设置chunk大小的上限

    最近在看memcached的源代码,源码包是memcached-1.4.22,一开始看memcached.c的main函数的时候发现了和1.2.8的不同之处. 可能在1.4.22版本之前就已经添加了这 ...

  7. 转一篇:Hyper-V和VMware的高可用实时迁移技术详解

    ESX里以集群的ha.drs.dpm功能实现 HYPER-V里以集群+共享存储实现. ~~~~~~~~~~ 微软公司的Hyper-V虚拟化管理程序一经面世就引发了业界的普遍关注.本文意在对Hyper- ...

  8. h.264加权预测

    帧间运动是基于视频亮度(luma)不发生改变的一个假设,而在视频序列中经常能遇到亮度变化的场景,比如淡入淡出.镜头光圈调整.整体或局部光源改变等,在这些场景中,简单帧间运动补偿的效果可想而知(实际编码 ...

  9. 一张图看懂片式多层陶瓷电容器(MLCC)

  10. Java实现八皇后

    实验题目   回溯法实现8皇后问题 实验要求   a.掌握递归回溯算法的基本思想. b.学习掌握应用面向对象通用回溯程序框架解决实际问题.  提高面向对象编程的技能. 作业描述:在8*8格的棋盘上放置 ...