无法再通过 SSH 登录

无法再通过 SSH 登录

我在通过简单密码进行 SSH 登录时遇到了奇怪的行为。我有 2 台装有 RHEL 7.4 的虚拟机,第二台虚拟机运行正常,我可以使用密码通过 SSH 登录。使用第一台虚拟机时,我收到“权限被拒绝”的提示。我可以通过控制台以 root(或任何其他用户)身份登录,因此密码是正确的(我也重置了密码)。第一个节点和第二个节点之间的 sshd_config 完全相同,因此我相信问题不在 openssh-server 中。

以下是完整的 ssh -vvv 日志:

https://pastebin.com/PvAZENSL

结尾是:

[email protected]'s password:
debug3: send packet: type 50
debug2: we sent a password packet, wait for reply
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey,password
Permission denied, please try again.

编辑:我启用了 sshd -d 作为服务器,但出现以下信息:pam password authentication failed for root module is unknown https://i.stack.imgur.com/b4hL7.png 我不知道这是否有助于解决问题!

有人能告诉我一个可行的解决方案吗?非常感谢,卢卡斯

答案1

知道了! 有人以错误的方式更改了一些安全操作系统文件:/etc/pam.d/sshd 和 /etc/pam.d/system-auth。我恢复了原始文件并执行以下操作:

authconfig --updateall

现在我可以再次通过 SSH 登录了!

相关内容