更改root用户密码
passwd后面不需要跟root,然后输入2次密码就OK了
[root@evan-01 ~]# passwd
Changing password for user root.
New password:
BAD PASSWORD: The password is a palindrome
Retype new password:
passwd: all authentication tokens updated successfully.
[root@evan-01 ~]#
更改普通用户密码
passwd[用户名]然后输入2次密码就OK了
[root@evan-01 ~]# passwd user1
Changing password for user user1.
New password:
BAD PASSWORD: The password is a palindrome
Retype new password:
passwd: all authentication tokens updated successfully.
[root@evan-01 ~]#
查看密码文件
[root@evan-01 ~]# tail /etc/shadow
polkitd:!!:18116::::::
postfix:!!:18116::::::
sshd:!!:18116::::::
chrony:!!:18116::::::
evan1:$6$sZaQ18JJ$a3fX2DGLV/ag4CJAdhb/zbJFqQTR6cAW/Grs7HwdkE6mDit8CRW4uw43LiWDWjn/JSsfYGqUcJSY6ul9ruUgX0:18121:0:99999:7:::
evan2:!!:18117:0:99999:7:::
user1:$6$tEdKB6NX$XqPFZAI.5DO9dpe9xRt3vEpPR6RT4RzjOOqcHPbwzLerUqs5G61NbvMZuckJk150/DijWokQRq5IKdoZ/K9ip1:18122:0:99999:7:::
user2:!!:18122:0:99999:7:::
user3:!!:18122:0:99999:7:::
user4:!!:18122:0:99999:7:::
[root@evan-01 ~]#
我们发现 evan1 user1 的第二位有很长的字符串,这个就是加密后的密码。
其余的都是 !! ,表示密码为空,这种用户是没办法登录的
[root@evan-01 ~]# head /etc/shadow
root:$6$467R9iiw$/mXoEB6meTeGJjfnWs9HvJz5swLTkKk5zFYiHv6iJuz3wUDvkcPHUXuGz60SP9XTOlb05xnRWQ2QHCsrqwk.R0:18122:0:99999:7:::
bin:*:17110:0:99999:7:::
daemon:*:17110:0:99999:7:::
adm:*:17110:0:99999:7:::
lp:*:17110:0:99999:7:::
sync:*:17110:0:99999:7:::
shutdown:*:17110:0:99999:7:::
halt:*:17110:0:99999:7:::
mail:*:17110:0:99999:7:::
operato