删除system-auth后如何以root用户登录

删除system-auth后如何以root用户登录

我想为我的帐户使用旧密码。我正在使用 OpenEuler 操作系统发行版。在 Stack Exchange 上搜索后,我找到了这个链接。

如何重新使用旧密码?

我遵循了下面列出的完全相同的步骤:

除了删除或清除/etc/security/opasswd文件之外,还可以查看/etc/pam.d/system-auth/etc/pam.d/password-auth 是否包含类似的内容

password    requisite     pam_pwhistory.so use_authtok remember=24

remember=#只需暂时删除所有实例即可重新使用现有密码。然后一旦设置,您就可以恢复remember=#

之后我就无法登录root用户了。我什至无法使用任何用户 ssh 服务器。我需要做什么?

答案1

对于此类锁定的一般建议是获取 Linux 的实时版本并从中启动。安装磁盘并撤消更改。

因为并不是每个人都会阅读评论:克里斯戴维斯说:当您更改身份验证内容时,请保持带有 root-shell 的终端打开,并保留原始文件的副本。

remember=#请注意,从 中删除pam_pwhistory.so可能会使默认值处于活动状态,即 10:

   remember=N
      The last N passwords for each user are saved. The default is
      10. Value of 0 makes the module to keep the existing contents
      of the opasswd file unchanged.

另外,您需要确保这 pam_pwhistory.so不是列表中的最后一个模块。

相关内容