gitlab root 密码忘记了,修改密码
程序员文章站
2022-05-31 19:59:10
...
#进入gitlab控制台
[[email protected] ~]# gitlab-rails console production
Loading production environment (Rails 4.2.8)
#获取第一个用户,可以看到第一个默认为 root
irb(main):001:0> user = User.where(id:1).first
=> #<User id:1 @root>
#设置新密码
irb(main):002:0> user.password='xxx123456'
=> "xxx123456"
#保存设置
irb(main):003:0> user.save!
Enqueued ActionMailer::DeliveryJob (Job ID: 24cef58c-cc7a-4306-ac2f-d129877fd44e) to Sidekiq(mailers) with arguments: "DeviseMailer", "password_change", "deliver_now", gid://gitlab/User/1
=> true
上一篇: gitlab内存占用过大