当前位置: 首页 > news >正文

linux之/etc/default/useradd文件

/etc/default/useradd文件是在使用useradd添加用户时,一个需要调用的默认的配置文件之一,可以使用命令"useradd -D"进行修改。

useradd用法:

[root@centos79-3 mail]# useradd --help
Usage: useradd [options] LOGINuseradd -Duseradd -D [options]Options:-b, --base-dir BASE_DIR       base directory for the home directory of thenew account-c, --comment COMMENT         GECOS field of the new account-d, --home-dir HOME_DIR       home directory of the new account-D, --defaults                print or change default useradd configuration-e, --expiredate EXPIRE_DATE  expiration date of the new account-f, --inactive INACTIVE       password inactivity period of the new account-g, --gid GROUP               name or ID of the primary group of the newaccount-G, --groups GROUPS           list of supplementary groups of the newaccount-h, --help                    display this help message and exit-k, --skel SKEL_DIR           use this alternative skeleton directory-K, --key KEY=VALUE           override /etc/login.defs defaults-l, --no-log-init             do not add the user to the lastlog andfaillog databases-m, --create-home             create the user's home directory-M, --no-create-home          do not create the user's home directory-N, --no-user-group           do not create a group with the same name asthe user-o, --non-unique              allow to create users with duplicate(non-unique) UID-p, --password PASSWORD       encrypted password of the new account-r, --system                  create a system account-R, --root CHROOT_DIR         directory to chroot into-P, --prefix PREFIX_DIR       prefix directory where are located the /etc/* files-s, --shell SHELL             login shell of the new account-u, --uid UID                 user ID of the new account-U, --user-group              create a group with the same name as the user-Z, --selinux-user SEUSER     use a specific SEUSER for the SELinux user mapping[root@centos79-3 mail]# 

/etc/default/useradd文件

[root@centos79-3 default]# pwd
/etc/default
[root@centos79-3 default]# cat useradd
# useradd defaults file
GROUP=100
HOME=/home
INACTIVE=-1
EXPIRE=
SHELL=/bin/bash
SKEL=/etc/skel
CREATE_MAIL_SPOOL=yes[root@centos79-3 default]# 
/etc/default/useradd文件说明
key=value说明
GROUP=100 用户默认GID.若是在添加新用户的时候没有指定GID,那么Linux系统有两种做法:一是把它添加到统一的组里面,就是这里的这个组;二是添加到和用户UID同名的GID中,即创建一个新的组且GID=HID.但是这些都不是可取的,最好的方法是每添加一个用户都应该想好,这个用户是属于那个部门(组)的,不应该出现一个不知道该放哪一个组的用户。
HOME=/home指定缺省宿主目录存放的目录
INACTIVE=-1账户是否被禁用 -1:不禁用  0:禁用
EXPIRE= 账号失效时间,比如临时加入该项目的成员,添加临时账户,那么项目完成后就让这些临时账户失效;不设置表示永久有效
SHELL=/bin/bash缺省使用的shell
SKEL=/etc/skel新用户宿主目录下的文件存放路径
CREATE_MAIL_SPOOL=yes新用户是否要创建一个和用户同名的保存邮件信息的文件

http://www.lryc.cn/news/184784.html

相关文章:

  • 3.primitive主数据类型和引用 认识变量
  • 【群智能算法改进】一种改进的光学显微镜算法 IOMA算法[1]【Matlab代码#60】
  • 第三课-软件升级-Stable Diffusion教程
  • 【C++】设计模式之——建造者
  • 【C++】基础语句(学习笔记)
  • 大厂秋招真题【DP】米哈游20230924秋招T2-米小游与魔法少女-奇运
  • LVS+Keepalived 高可用集群负载均衡
  • Qt QList类和QLinkedList类 详解
  • Mac安装GYM遇到的一些坑
  • 【高级rabbitmq】
  • 数百个下载能够传播 Rootkit 的恶意 NPM 软件包
  • SpringBoot的error用全局异常去处理
  • MyBatisPlus(十一)包含查询:in
  • Linux命令定位与查找:which、whereis和find的用法详解
  • LeetCode 面试题 17.10. Find Majority Element LCCI【摩尔投票法】简单
  • 多校联测11 模板题
  • Linux SSH连接远程服务器(免密登录、scp和sftp传输文件)
  • 从0开始python学习-30.selenium frame子页面切换
  • asp.net core 远程调试
  • Java spring boot 一次调用多个请求
  • DRM全解析 —— CRTC详解(4)
  • 六个为Rust构建的IDE
  • 25 Python的collections模块
  • JEPG Encoder IP verilog设计及实现
  • yolov5 web端部署进行图片和视频检测
  • 嵌入式养成计划-34--函数库
  • PM864AK01-eA 3BSE018161R2 工业人工智能供应链先驱
  • 参与现场问题解决总结(Kafka、Hbase)
  • 基于PSD-ML算法的语音增强算法matlab仿真
  • 【1++的Linux】之文件(一)