gitlab 修改超级管理员密码

官方修改密码:(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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值