gitlab web登入密码忘记以后可以用如下方式修改密码`
[root@gitlab ~]# gitlab-rails console production
-------------------------------------------------------------------------------------
GitLab: 12.0.3 (08a51a9db93)
GitLab Shell: 9.3.0
PostgreSQL: 10.7
-------------------------------------------------------------------------------------
Loading production environment (Rails 5.1.7)
irb(main):001:0>
irb(main):001:0> user = User.where(id: 1).first //id为1的是超级管理员
Loading production environment (Rails 5.1.7)
irb(main):001:0> user = User.where(id: 1).first
=> #<User id:1 @root>
irb(main):002:0>
irb(main):002:0>user.password = ‘yourpassword’ //密码必须至少8个字符
irb(main):003:0>user.save! // 如没有问题 返回true
irb(main):002:0> user.password = 'asdfghjkl'
=> "asdfghjkl"
irb(main):003:0> user.save!
Enqueued ActionMailer::DeliveryJob (Job ID: bb653d92-d5ed-4356-b3a6-ec7d79f76029) to Sidekiq(mailers) with arguments: "DeviseMailer", "password_change", "deliver_now", #<GlobalID:0x00007fccc43a56e0 @uri=#<URI::GID gid://gitlab/User/1>>
=> true
irb(main):004:0>
密码修改完成,去登陆吧!