How to change the admin password on GitLab
To Change admin password on Gitlab.
Introduction:
Gitlab admin password can be changed easily by using GitLab-rails command. We may have chance of forgetting GitLab admin password, so if we do we actually don’t need to reinstall GitLab just follow the simple steps to reset your GitLab admin password. This tutorial covers the ground on resetting the admin password on Gitlab.
Configuration Steps:
Step 1: To check the os version.
[root@linuxhelp ~]# cat /etc/os-release
NAME=Fedora
VERSION="34 (Workstation Edition)"
ID=fedora
VERSION_ID=34
PLATFORM_ID="platform:f34"
PRETTY_NAME="Fedora 34 (Workstation Edition)"
ANSI_COLOR="0;38;2;60;110;180"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:fedoraproject:fedora:34"
HOME_URL="https://fedoraproject.org/"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f34/system-administrators-guide/"
SUPPORT_URL="https://fedoraproject.org/wiki/Communicating_and_getting_help"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=34
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=34
PRIVACY_POLICY_URL="https://fedoraproject.org/wiki/Legal:PrivacyPolicy"
VARIANT="Workstation Edition"
VARIANT_ID=workstation
Step 2: To execute this gitlab password rest command.
[root@linuxhelp ~]# gitlab-rails console -e production
--------------------------------------------------------------------------------
Ruby: ruby 2.7.4p191 (2021-07-07 revision a21a3b7d23) [x86_64-linux]
GitLab: 14.4.2 (1ce86e92f81) FOSS
GitLab Shell: 13.21.1
PostgreSQL: 12.7
--------------------------------------------------------------------------------
Loading production environment (Rails 6.1.4.1)
irb(main):001:0> u = User.where(id:1).first
=> #<User id:1 @root>
irb(main):002:0> u.password = '!@#$%^&*'
=> "!@\#$%^&*"
irb(main):003:0> u.password_confirmation = '!@#$%^&*'
=> "!@\#$%^&*"
irb(main):004:0> u.save!
Enqueued ActionMailer::MailDeliveryJob (Job ID: 58f04156-cf5e-4d90-aadb-6bae885105d3) to Sidekiq(mailers) with arguments: "DeviseMailer", "password_change", "deliver_now", {:args=>[#<GlobalID:0x00007fe19c8682d0 @uri=#<URI::GID gid://gitlab/User/1>>]}
=> true
irb(main):005:0>exit
Step 3: Then go to the browser search your gitlab and enter login details.
with This Gitlab admin password reset process comes to an End
Comments ( 0 )
No comments available