gitlab reset the root password

gitlab administrator accounts can be created for ordinary user accounts, assign permissions, have permission to all projects and groups, after the completion of the new ordinary users, the administrator needs to assign appropriate privileges to normal use. If you forget the password for the administrator account, usually through mail back, but if the mailbox had managed account settings can not be used, in fact, can be forced to reset the way also to retrieve the password, down below on how to introduce mandatory retrieve

Solution:
gitlab ensure gitlab Start-CTL is active, & ensure redis is active
gitlab-rails console production environment into the next serial gitlab
irb (main): 001: 0 > user = User.where (id: 1) .first Location users to a user table gitlab database administrator user is usually [email protected]
IRB (main): 002: 0> = 12345678 user.password administrator password is reset 12345678
IRB (main): 003: 0 > user.password_confirmation = 12345678 confirmation administrator password is 12345678
irb (main): 004: 0> to save the changes user.save information!

# su - git
-sh-4.2$ gitlab-rails console production
-------------------------------------------------------------------------------------
 GitLab:       12.0.3 (08a51a9db93)
 GitLab Shell: 9.3.0
 PostgreSQL:   10.7
-------------------------------------------------------------------------------------
Loading production environment (Rails 5.1.7)
irb(main):001:0> user = User.where(id: 1).first
=> #<User id:1 @root>
irb(main):004:0> user.password=12345678
=> 12345678
irb(main):005:0> user.save!
Enqueued ActionMailer::DeliveryJob (Job ID: 60439440-6443-46d1-acda-e29172be146a) to Sidekiq(mailers) with arguments: "DeviseMailer", "password_change", "deliver_now", #<GlobalID:0x00007f09e949b958 @uri=#<URI::GID gid://gitlab/User/1>>
=> true
irb(main):006:0> exit
-sh-4.2$ exit
[root@qas-k8s-gitlab gitlab]# gitlab-ctl restart
ok: run: alertmanager: (pid 43507) 0s
ok: run: gitaly: (pid 43523) 0s
ok: run: gitlab-monitor: (pid 43542) 1s
ok: run: gitlab-workhorse: (pid 43550) 0s
ok: run: grafana: (pid 43563) 1s
ok: run: logrotate: (pid 43576) 0s
ok: run: nginx: (pid 43659) 1s
ok: run: node-exporter: (pid 43665) 0s
ok: run: postgres-exporter: (pid 43671) 0s
ok: run: postgresql: (pid 43680) 1s
ok: run: prometheus: (pid 43690) 0s
ok: run: redis: (pid 43701) 1s
ok: run: redis-exporter: (pid 43705) 0s
ok: run: sidekiq: (pid 43715) 0s
ok: run: unicorn: (pid 43726) 1s

Guess you like

Origin blog.51cto.com/10880347/2426529