Gitlab通过控制台重置密码及解锁用户
参考官方文档
https://docs.gitlab.com/ee/security/reset_root_password.html
https://docs.gitlab.com/ee/security/unlock_user.html
https://docs.gitlab.com/ee/security/reset_root_password.html
https://docs.gitlab.com/ee/security/unlock_user.html
操作背景
Gitlab是Docker部署,Jenkins账号登陆不了,开始是怀疑密码不对,通过控制台登陆重置了密码,还是登陆不了,怀疑是Jenkins用户被锁住了(默认错误登陆超过10次会锁定),解锁后登陆成功。
操作步骤
1.登陆Gitlab所在容器
[ ~]# docker exec -it gitlab /bin/bash :/# ls RELEASE bin dev home lib64 mnt proc run srv tmp var assets boot etc lib media opt root sbin sys usr
2.登陆控制台
:/# gitlab-rails console production Loading production environment (Rails 4.2.10)
3.通过邮箱找到用户
irb(main):003:0> user=User.where(email:‘‘).first => #<User id:12 @jenkins>
4.修改密码并保存
irb(main):005:0> user.password=12345678 => 12345678 irb(main):006:0> user.password_confirmation=12345678 => 12345678 irb(main):007:0> user.save! Enqueued ActionMailer::DeliveryJob (Job ID: 53d8c7ea-c523-43a1-a5e6-032c836f4870) to Sidekiq(mailers) with arguments: "DeviseMailer", "password_change", "deliver_now", gid://gitlab/User/22 => true
5.解锁用户
irb(main):012:0> user=User.where(email:‘‘).first => #<User id:22 @jenkins> irb(main):013:0> user.unlock_access! => true irb(main):014:0>
相关推荐
cxin 2020-11-06
synshitou 2020-10-21
Topbeyond 2020-08-21
happyfreeangel 2020-07-27
白开水 2020-07-19
无风的雨 2020-07-08
贤时间 2020-07-06
wishli 2020-06-28
小信 2020-06-21
leehbhs 2020-06-20
happyfreeangel 2020-06-18
83284950 2020-06-17
冯冯领队 2020-06-16
就是那个胖子 2020-06-14
83284950 2020-06-14
LiHansiyuan 2020-06-14
就是那个胖子 2020-06-11
蒜蓉粉丝蒸扇贝 2020-06-10