How to reset Gitlab admin password On CentOS 8.1
To Reset GitLab Admin Password On CentOS 8.1
INTRODUCTION:
Gitlab admin password is simply changed by using the gitlab-rails command. The Rails console. gives a way to link with the GitLab instance from the command line. It is for administrators of the GitLab system to troubleshooting problems or needs to retrieve data.
Procedure:
Start A Ruby On Rails console using the following command
[root@linuxhelp ~]# gitlab-rails console -e production
--------------------------------------------------------------------------------
GitLab: 13.5.4 (7f5f940041c) FOSS
GitLab Shell: 13.11.0
PostgreSQL: 11.9
--------------------------------------------------------------------------------
Loading production environment (Rails 6.0.3.3)
irb(main):058:0> user = User.where(id:1).first
=> #<User id:1 @root>
Create password and after it make it confirm again using following command
irb(main):059:0> user.password = 'Abhishek@net123'
=> "Abhishek@net123"
irb(main):060:0> user.password_confirmation ='Abhishek@net123'
=> "Abhishek@net123"
Now save it using the following command
irb(main):063:0> user.save!
Enqueued ActionMailer::MailDeliveryJob (Job ID: 50536092-d78e-4645-808f-2fbd492b3256) to Sidekiq(mailers) with arguments: "DeviseMailer", "password_change", "deliver_now", {:args=>[#<GlobalID:0x00007f3e7a757c58 @uri=#<URI::GID gid://gitlab/User/1>>]}
=> true
Now go to browser and login with new password
Login got successful

With this method, the password reset process in GitLab for admin comes to an end.
Comments ( 0 )
No comments available