当前位置:网站首页>RHCSA 07 - 用户与群组管理
RHCSA 07 - 用户与群组管理
2022-07-04 03:51:00 【王万林 Ben】
RHEL 8在/etc/login.defs定义了新创建用户的属性,
[[email protected] ~]# cat /etc/login.defs | grep -v '^#'
MAIL_DIR /var/spool/mail
UMASK 022
HOME_MODE 0700
PASS_MAX_DAYS 99999
PASS_MIN_DAYS 0
PASS_MIN_LEN 5
PASS_WARN_AGE 7
UID_MIN 1000
UID_MAX 60000
SYS_UID_MIN 201
SYS_UID_MAX 999
GID_MIN 1000
GID_MAX 60000
SYS_GID_MIN 201
SYS_GID_MAX 999
CREATE_HOME yes
USERGROUPS_ENAB yes
ENCRYPT_METHOD SHA512
修改密码有效期
[[email protected] ~]# sed -i 's/99999/90/' /etc/login.defs
在/etc/skel文件夹里创建文件,任何在该目录下的文件将会被拷贝到新创建用户的家目录,
[[email protected] ~]# echo hello > /etc/skel/greetings
创建用户anna,增加secondary群组sales,
[[email protected] ~]# groupadd sales
[[email protected] ~]# useradd -G sales anna
[[email protected] ~]# echo mysecretpassword | passwd --stdin anna
Changing password for user anna.
passwd: all authentication tokens updated successfully.
[[email protected] ~]# id anna
uid=1001(anna) gid=1002(anna) groups=1002(anna),1001(sales)
查看密码有效期,
[[email protected] ~]# chage -l anna
Last password change : Jul 02, 2022
Password expires : Sep 30, 2022
Password inactive : never
Account expires : never
Minimum number of days between password change : 0
Maximum number of days between password change : 90
Number of days of warning before password expires : 7
查看anna的家目录,看/etc/skel的文件已经被copy过来了,
[[email protected] ~]# ls -al /home/anna
total 16
drwx------. 2 anna anna 79 Jul 2 07:06 .
drwxr-xr-x. 4 root root 32 Jul 2 07:06 ..
-rw-r--r--. 1 anna anna 18 Jul 27 2021 .bash_logout
-rw-r--r--. 1 anna anna 141 Jul 27 2021 .bash_profile
-rw-r--r--. 1 anna anna 376 Jul 27 2021 .bashrc
-rw-r--r--. 1 anna anna 6 Jul 2 07:06 greetings
边栏推荐
- 华为云鲲鹏工程师培训(广西大学)
- 透过JVM-SANDBOX源码,了解字节码增强技术原理
- Common methods of threads
- leetcode刷题:二叉树04(二叉树的层序遍历)
- [book club issue 13] multimedia processing tool ffmpeg tool set
- 【读书会第十三期】多媒体处理工具 FFmpeg 工具集
- Katalon中控件的参数化
- 深度优先搜索简要讲解(附带基础题)
- Redis cluster view the slots of each node
- PostgreSQL users cannot create table configurations by themselves
猜你喜欢
1289_ Implementation analysis of vtask suspend() interface in FreeRTOS
My opinion on how to effectively telecommute | community essay solicitation
EV6 helps the product matrix, and Kia is making efforts in the high-end market. The global sales target in 2022 is 3.15 million?
用于TCP协议交互的TCPClientDemo
Storage of MySQL database
Unity 绘制弹球和台球的运动轨迹
Wechat official account web page authorization
Balance between picture performance of unity mobile game performance optimization spectrum and GPU pressure
SQL語句加强練習(MySQL8.0為例)
leetcode刷题:二叉树06(对称二叉树)
随机推荐
Balance between picture performance of unity mobile game performance optimization spectrum and GPU pressure
Global exposure and roller shutter exposure of industrial cameras
【webrtc】m98 ninja 构建和编译指令
Katalon framework tests web (XXI) to obtain element attribute assertions
拼夕夕二面:说说布隆过滤器与布谷鸟过滤器?应用场景?我懵了。。
Support the first triggered go ticker
C语言双向链表初版
leetcode刷题:二叉树05(翻转二叉树)
Distributed system: what, why, how
【华为云IoT】读书笔记之《万物互联:物联网核心技术与安全》第3章(上)
Penetration practice - sqlserver empowerment
10 reasons for not choosing to use free virtual hosts
leetcode刷题:二叉树08(N叉树的最大深度)
pytest多进程/多线程执行测试用例
[paddleseg source code reading] paddleseg calculation dice
Pointer array and array pointer
Redis cluster view the slots of each node
ctf-pikachu-XSS
I Build a simple microservice project
Myslq delete followed by limit