【问题标题】:Cannot Change Root Passwd无法更改根密码
【发布时间】:2013-07-08 18:56:00
【问题描述】:

我知道有很多关于此的帖子,但似乎找不到对我有用的答案。

我想更改我的 root 用户的密码,但没有成功。

以root身份登录; root@ubuntu:/密码

密码:权限被拒绝

passwd:密码不变

root@ubuntu:/ sudo passwd root passwd:权限被拒绝;; passwd:密码不变;;

这是一个 ubuntu 10.04 系统,我不知道如何解决这个问题。 我曾尝试更改 PAM 文件以及 login.defs 文件,但无济于事。谁能帮帮我?

【问题讨论】:

    标签: root ubuntu-10.04 passwd


    【解决方案1】:
    sudo passwd root
    

    现在你看到它要求输入 root 的新密码。所以重置它并享受吧:)

    $su root
    

    提供您输入的新密码

    【讨论】:

      【解决方案2】:

      通过grub进入recovery模式,选择进入root shell。从那里:

      passwd <user>
      

      无需卸载驱动器。

      【讨论】:

      • 我无法卸载驱动器,因为它运行网站的关键应用程序。
      • 是的,我是。 Sudo 适用于一切。但是,不是当我想更改 root 用户的密码时
      • /etc/passwd/etc/shadow的权限是什么?
      • -rw-r--r-- 1 root root 1466 2013-06-09 23:04 /etc/passwd ### -rw-r----- 1 root root 986 2013 -06-09 23:04 /etc/shadow
      • 如果更改 root 密码不是时间紧迫的,也许只是安排服务器停机时间和unmount the drive?不是解决方案,我知道,但仍然......
      【解决方案3】:

      确保您的 /etc/pam.d/common-password 看起来像这样

      # here are the per-package modules (the "Primary" block)
      password        [success=1 default=ignore]      pam_unix.so obscure sha512
      # here's the fallback if no module succeeds
      password        requisite                       pam_deny.so
      # prime the stack with a positive return value if there isn't one already;
      # this avoids us returning an error just because nothing sets a success code
      # since the modules above will each just jump around
      password        required                        pam_permit.so
      # and here are more per-package modules (the "Additional" block)
      # end of pam-auth-update config
      

      【讨论】:

        猜你喜欢
        • 2023-03-12
        • 2018-12-21
        • 2013-09-06
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-12-27
        • 1970-01-01
        相关资源
        最近更新 更多