【问题标题】:Unable to ssh into locked user无法 ssh 进入锁定的用户
【发布时间】:2014-08-08 01:49:46
【问题描述】:

我正在关注 Capistrano (http://capistranorb.com/documentation/getting-started/authentication-and-authorisation/) 的设置指南。但是我发现我无法使用锁定用户(“部署”)进入计算机。我检查了/var/log/auth.log,它说:

sshd[29163]: User deploy not allowed because account is locked
sshd[29163]: input_userauth_request: invalid user deploy [preauth]

在我使用passwd -u deploy 解锁用户后,我可以通过 ssh 进入计算机。

我检查了 passwd 的手册页,上面写着:

-l, --lock
       Lock the password of the named account. This option disables a password by changing it to a value which matches no possible encrypted value (it adds a ´!´ at the
       beginning of the password).

       Note that this does not disable the account. The user may still be able to login using another authentication token (e.g. an SSH key). To disable the account,
       administrators should use usermod --expiredate 1 (this set the account's expire date to Jan 2, 1970).

       Users with a locked password are not allowed to change their password.

部分“请注意,这不会禁用帐户。用户可能仍然能够使用另一个身份验证令牌(例如SSH密钥)登录。”看来我应该能够在用户锁定的情况下通过 ssh 进入计算机,但这不是我所看到的。有谁知道为什么?我正在运行 Ubuntu 12.04.4 LTS。

【问题讨论】:

    标签: linux ssh capistrano


    【解决方案1】:

    手册页所说的并不是您将能够使用 SSH 登录到锁定的帐户。手册页上说的是,如果您为非密码登录帐户设置了 SSH 密钥,那么当密码被锁定时,这样的登录可能仍然有效,因为 SSH 密钥登录使用的是 SSH 密钥将密码作为身份验证令牌,绕过会失败的密码身份验证步骤。

    但是,即使使用非密码登录工作,它也只是说它可能工作。身份验证过程由 PAM 部分控制/管理,因此,如果您设置了 SSH 密钥,并且您可以在没有密码的情况下登录到“部署”用户,只要它具有有效密码,并且当密码被锁定时您无法登录到“部署”用户,请查看您的 PAM 配置。

    【讨论】:

      【解决方案2】:

      在 Ubuntu 中,如果您的用户根本没有密码,它可能会被锁定。设置一个确实为我解决了几次问题

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2014-06-17
        • 1970-01-01
        • 2017-07-30
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多