How to Change the Administrator Password in GitLab-CE on CentOS 7.6

Change the Administrator Password In GitLab-CE On CentOS 7.6

Password Reset Process:

Verify the version of Gitlab-CE through the below command

[root@linuxhelp ~]# head -1 /opt/gitlab/version-manifest.txt
gitlab-ce 12.0.3

Login to the Gitlab Console using rails and reset the password as follows

[root@linuxhelp ~]# 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):003:0> u=User.where(id:1).first
=> #<User id:1 @root>
irb(main):007:0> u.password='lucky@abcd'
=> "lucky@abcd"
irb(main):012:0> u.password_confirmation='lucky@abcd'
=> "lucky@abcd"
irb(main):016:0> u.save!
Enqueued ActionMailer::DeliveryJob (Job ID: 3b3610d9-d5eb-49f9-94b6-0b6ca6eab403) to Sidekiq(mailers) with arguments: "DeviseMailer", "password_change", "deliver_now", #<GlobalID:0x00007f299c110b80 @uri=#<URI::GID gid://gitlab/User/1>>
=> true
irb(main):020:0> exit

Reconfigure the Gitlab to update the changes

[root@linuxhelp ~]# gitlab-ctl reconfigure
Starting Chef Client, version 13.6.4
resolving cookbooks for run list: ["gitlab"]
Synchronizing Cookbooks:
  - gitlab (0.0.1)
  - package (0.1.0)
  - postgresql (0.1.0)
  - redis (0.1.0)
  - registry (0.1.0)
  - mattermost (0.1.0)
  - consul (0.1.0)
  - gitaly (0.1.0)
  - nginx (0.1.0)
  - runit (4.3.0)
  - acme (3.1.0)
  - crond (0.1.0)
  - letsencrypt (0.1.0)
  - compat_resource (12.19.1)
Installing Cookbook Gems:
Compiling Cookbooks...
.
.
.
.
.

Running handlers:
Running handlers complete
Chef Client finished, 2/665 resources updated in 44 seconds
gitlab Reconfigured!

Open your browser and enter the Gitlab Account URL Log in to the Gitlab Account with the reset password With this. Administrator password has been changed In Gitlab-CE 12.0.3 Version on CentOS 7.6

FAQ
Q
How will you save the password while changing the administrator password in gitlab rails console?
A
u.save! is the command to save the password while changing the administrator password in gitlab rails console.
Q
What is the command to change the password of an administrator in gitlab using rails console?
A
The command to change the password of the administrator in Gitlab using rails console is u.password='$password' where $password is the password that you would like to change.
Q
What is the difference between Ruby and ruby on rails in Gitlab?
A
Ruby is a programming language whereas ruby On rails is a web framework in Gitlab
Q
What is irb in Gitlab-rails console?
A
irb is an interactive ruby shell Which is a REPL in Gitlab-rails console
Q
What does IRB stand for while changing the Administrators password In Gitlab-CE 12.0.3
A
irb stands for Interactive ruby while changing the Administrators password in Gitlab-CE 12.0.3