无法ssh到被锁定的用户



我遵循Capistrano的设置指南(http://capistranorb.com/documentation/getting-started/authentication-and-authorisation/)。然而,我发现我不能ssh到计算机与锁定用户("部署")。我检查了/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

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

然而,即使非密码登录工作,它也只说它可能工作。身份验证过程部分地由PAM控制/管理,因此,如果您设置了SSH密钥,并且只要它具有有效密码,您就可以不需要密码就登录到'deploy'用户,并且当密码被锁定时,您无法登录到'deploy'用户,请查看您的PAM配置。

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

最新更新