# GitLab 重置密码
# GitLab in docker
进入到容器当中
$ docker exec -it gitlab /bin/bash
1Ruby on Rails console
$ gitlab-rails console production
1查找
root
用户irb(main):006:0> user = User.where(id: 1).first
1或者按照邮箱查找用户
irb(main):006:0> user = User.find_by(email: 'admin@example.com')
1
重置密码(要求不少于8位)
irb(main):006:0> user.password = 'secret_pass' irb(main):006:0> user.password_confirmation = 'secret_pass'
1
2保存更改
irb(main):006:0> user.save!
1