Linux修改密码成功,却无法登录

项目场景:

Linux修改密码成功,却无法登录

问题描述

等保服务器密码过期后,修改密码,登录显示密码错误,后台vnc修改密码后,新密码无法登录
使用passwd修改密码

[root@localhost ~]# passwd admin  
Changing password for user admin. 
New password: 
Retype new password: 
passwd: all authentication tokens updated successfully.

显示密码修改成功,但是无法登录


原因分析:

查看secure日志

tail -f /var/log/secure

显示:

Nov 16 09:20:13 xxxxx sshd[11450]: pam_tally2(sshd:auth): user admin (1003) tally 47, deny 5
Nov 16 09:20:13 xxxx sshd[11450]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=xxxxxx  user=admin
Nov 16 09:20:15 xxxxx sshd[11450]: Failed password for admin from xxxxx port 59485 ssh2
Nov 16 09:20:23 xxxxx sshd[11450]: pam_tally2(sshd:auth): user admin (1003) tally 48, deny 5
Nov 16 09:20:25 xxxxx sshd[11450]: Failed password for admin from xxxx port 59485 ssh2
Nov 16 09:20:46 xxxxx sshd[11450]: pam_tally2(sshd:auth): user admin (1003) tally 49, deny 5
Nov 16 09:20:48 xxxxx sshd[11450]: Failed password for admin from xxxxxxx port 59485 ssh2

密码错误超过次数被限制了!

解决方案:

使用如下命令,清除密码错误次数,或者等待时间限制解除

pam_tally2 --user 用户名 --reset

你可能感兴趣的:(Linux,linux,服务器,运维)