官方修改密码:(http://docs.gitlab.com/ce/security/reset_root_password.html)
root权限登录gitlab server 服务器
[root@web1 ~]# gitlab-rails console production
-------------------------------------------------------------------------------------
Gitlab: 10.8.4 (2268d0c)
Gitlab Shell: 7.1.2
postgresql: 9.6.8
-------------------------------------------------------------------------------------
Loading production environment (Rails 4.2.10)
irb(main):001:0> user = User.where(id: 1).first
=> #<User id:1 @root>
irb(main):002:0> user.password=12345678
=> 12345678
irb(main):003:0> user.password_confirmation=12345678
=> 12345678
irb(main):004:0> user.save!
Enqueued ActionMailer::DeliveryJob (Job ID: 3ef37c47-4b3f-49e5-aa53-904e725bd1a8) to Sidekiq(mailers) with arguments: "DeviseMailer", "password_change", "deliver_now", gid://gitlab/User/1
=> true
irb(main):005:0> quit
另外一篇
https://blog.csdn.net/Dream_Flying_BJ/article/details/54947226
要调用gitlab的api,因为初五gitlab运维小哥的pgsql的删除与跑路,我决定先在测试环境玩一玩,
重点是忘记密码了,先改个密码再说。
.到 gitlab 安装路径 && gitlab-rails console production
cd /opt/gitlab/bin && sudo gitlab-rails console production
cd YOUR_GITLAB_PATH && sudo gitlab-rails console production
u=User.where(id:1).first
u.password = 'YOUR_PASSWORD'
u.password_confirmation = 'YOUR_PASSWORD'
u.save!
irb(main):004:0> u.save!
Enqueued ActionMailer::DeliveryJob (Job ID: 4847c99e-eac6-4ed7-94aa-6d7de597a4bd) to Sidekiq(mailers) with arguments: "DeviseMailer", "password_change", "deliver_now", gid://gitlab/User/1
=> true
出来这么一行就改成功了
exit
————————————————
版权声明:本文为CSDN博主「Dream_Flying_BJ」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/Dream_Flying_BJ/article/details/54947226