当前位置:网站首页>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
边栏推荐
- Deep thinking on investment
- Getting started with the go language is simple: go implements the Caesar password
- CesiumJS 2022^ 源码解读[0] - 文章目录与源码工程结构
- Rhcsa-- day one
- User defined path and file name of Baidu editor in laravel admin
- Why is the probability of pod increasing after IPtable
- 拼夕夕二面:说说布隆过滤器与布谷鸟过滤器?应用场景?我懵了。。
- Go 语言入门很简单:Go 实现凯撒密码
- [Yugong series] go teaching course 002 go language environment installation in July 2022
- 还原窗口位置的微妙之处
猜你喜欢
MySQL maxscale realizes read-write separation
Reduce function under functools
Flink学习8:数据的一致性
Illustrated network: what is the hot backup router protocol HSRP?
Msgraphmailbag - search only driveitems of file types
CesiumJS 2022^ 源码解读[0] - 文章目录与源码工程结构
laravel admin里百度编辑器自定义路径和文件名
Flink学习7:应用程序结构
10 reasons for not choosing to use free virtual hosts
[Logitech] m720
随机推荐
Understand the principle of bytecode enhancement technology through the jvm-sandbox source code
函数计算异步任务能力介绍 - 任务触发去重
分布式系统:what、why、how
(指针)自己写一个比较字符串大小的函数,功能与strcmp类似。
Unity移动端游戏性能优化简谱之 画面表现与GPU压力的权衡
Sales management system of lightweight enterprises based on PHP
Balance between picture performance of unity mobile game performance optimization spectrum and GPU pressure
02 ls 命令的具体实现
Idea configuration 360zip open by default -- external tools
"Implement both software and hardware" to help build a new cloud computing data center
JDBC 进阶
vim正确加区间注释
Pandora IOT development board learning (HAL Library) - Experiment 6 independent watchdog experiment (learning notes)
MySQL maxscale realizes read-write separation
干货!基于GAN的稀有样本生成
leetcode刷题:二叉树06(对称二叉树)
[csrf-01] basic principle and attack and defense of Cross Site Request Forgery vulnerability
[Yugong series] go teaching course 002 go language environment installation in July 2022
vue多级路由嵌套怎么动态缓存组件
The maximum expiration time of client secret in azure ad application registration is modified to 2 years