gitlab 重置密码

sudo gitlab-rails console production
-------------------------------------------------------------------------------------
 GitLab:       11.1.4 (63daf37)
 GitLab Shell: 7.1.4
 postgresql:   9.6.8
-------------------------------------------------------------------------------------
Loading production environment (Rails 4.2.10)
irb(main):001:0> u=User.where(id:1).first
=> #<User id:1 @root>
irb(main):002:0> u.password='123456'
=> "123456"
irb(main):003:0> u.password_confirmation='123456'
=> "123456"
irb(main):004:0> u.save!
Enqueued ActionMailer::DeliveryJob (Job ID: 7bffac81-aab5-4d3a-b771-bdffb4145020) to Sidekiq(mailers) with arguments: "DeviseMailer", "password_change", "deliver_now", gid://gitlab/User/1
=> true
irb(main):005:0> exit
You have new mail in /var/spool/mail/root

1、sudo gitlab-rails console production

2、u=User.where(id:1).first

3、u.password='123456'

4、u.password_confirmation='123456'

5、u.save!

6、exit

posted @ 2019-07-01 09:39  TBHacker  阅读(3839)  评论(0编辑  收藏  举报