ssh不允许我登录,因为帐户已锁定。我想解锁服务器上的用户以通过ssh进行公钥授权,但不启用密码登录。
我试过了:
# passwd -u username
passwd: unlocking the password would result in a passwordless account.
You should set a password with usermod -p to unlock the password of this account.
验证日志条目:
Mar 28 00:00:00 vm11111 sshd[11111]: User username not allowed because account is locked
Mar 28 00:00:00 vm11111 sshd[11111]: input_userauth_request: invalid user username [preauth]
passwd -u
是个坏主意。参见Giles bellow的回答。