[root@localhost Desktop]# su - student [student@localhost ~]$ whoami
student
[student@localhost ~]$ exitlogout[root@localhost Desktop]# su - student
Last login: Sat Jan 11 08:54:48 EST 2020 on pts/0
[student@localhost ~]$ pwd
/home/student
[student@localhost ~]$ exitlogout[root@localhost Desktop]# su student(process:3248): dconf-CRITICAL **: 09:01:54.456: unable to create directory '/run/user/0/dconf': Permission denied. dconf will not work properly.
(process:3248): dconf-CRITICAL **: 09:01:54.457: unable to create directory '/run/user/0/dconf': Permission denied. dconf will not work properly.
(process:3248): dconf-WARNING **: 09:01:54.461: failed to commit changes to dconf: Could not connect: Permission denied
[student@localhost Desktop]$ pwd
/root/Desktop
[root@localhost Desktop]# passwd -l hehe
Locking password for user hehe.
passwd: Success
[root@localhost Desktop]# passwd -u hehe
Unlocking password for user hehe.
passwd: Success
[root@localhost Desktop]# passwd -S hehe
hehe PS 2020-01-10 0999997 -1 (Password set, SHA512 crypt.)[root@localhost Desktop]# passwd -n 1 hehe
Adjusting aging data for user hehe.
passwd: Success
[root@localhost Desktop]# passwd -x 1 hehe
Adjusting aging data for user hehe.
passwd: Success
[root@localhost Desktop]# passwd -x 1000 hehe
Adjusting aging data for user hehe.
passwd: Success
[root@localhost Desktop]# passwd -w 8 hehe
Adjusting aging data for user hehe.
passwd: Success
[root@localhost Desktop]# passwd -i 20200202 hehe
Adjusting aging data for user hehe.
passwd: Success
chage
chage的常用参数
参数
用途
-l
列出该账号的详细密码参数
-d
后面接日期,修改最后一次修改密码的日期
-E
后面接日期,修改账号失效日
-I
后面接天数,修改密码失效日期
-m
后面接天数,修改密码最短保留天数
-M
后面接天数,修改密码多久需要进行修改
-W
后面接天数,修改密码过期前警告日期
[root@localhost Desktop]# chage -l hehe
Last password change : Jan 11, 2020
Password expires : Oct 07, 2022
Password inactive : Jan 15, 57329
Account expires : never
Minimum number of days between password change :1
Maximum number of days between password change :1000
Number of days of warning before password expires :8
1、用户及用户组存在的意义用户是操作者在系统中的身份标识组是逻辑概念,是用户的集合用户的存在为了限制权限组的存在为了归类用户便于管理权限2、用户在系统中的存储方式用户在系统中就是文件中的字符串 vim /etc/passwd每个字符串映射了该用户所用到的系统资源3、用户涉及到的配置文件及内容配置文件内容/etc/passwd用户信息库/etc...