How to unlock a locked user from the command line
How to unlock a locked user from the command line
十次失败的登录尝试后,用户将进入锁定状态.
要解锁锁定的用户:
- SSH 到您的 GitLab 服务器.
 启动 Ruby on Rails 控制台:
## For Omnibus GitLab sudo gitlab-rails console -e production ## For installations from source sudo -u git -H bundle exec rails console -e production- 查找要解锁的用户. 您可以通过电子邮件或 ID 进行搜索.
 
user = User.find_by(email: 'admin@local.host')or
user = User.where(id: 1).first- 解锁用户:
 
user.unlock_access!- 使用
Ctrl+d退出控制台 
用户现在应该可以登录了.